diff options
| author | Scott Shawcroft <scott.shawcroft@gmail.com> | 2017-01-26 18:05:46 -0800 |
|---|---|---|
| committer | Scott Shawcroft <scott.shawcroft@gmail.com> | 2017-01-30 15:02:01 -0800 |
| commit | e3f9ee839afb5a369779a30a96214c929e76911e (patch) | |
| tree | 363c298b2de47fdfffdbcf1b8bdf78e128a72917 /esp8266/main.c | |
| parent | 749d22b5e63696f67356884b0b35ecebbabb001e (diff) | |
Add frequency changing support to PWMOut.
You can either set it once up front, or set variable_frequency on custruction to
indicate that the frequency must be able to change. This informs whether a timer
can be shared amongst pins.
This also adds persistent clock calibration on atmel-samd. Once the device has
synced its clock frequency over USB it will remember that config value until USB
is used again. This helps ensure the clock frequency is similar on and off USB.
Lastly, this also corrects time.sleep() when on USB by correcting the tick counter.
Diffstat (limited to 'esp8266/main.c')
| -rw-r--r-- | esp8266/main.c | 2 |
1 files changed, 2 insertions, 0 deletions
diff --git a/esp8266/main.c b/esp8266/main.c index 6c06f0e07..98db93d86 100644 --- a/esp8266/main.c +++ b/esp8266/main.c @@ -39,6 +39,7 @@ #include "gccollect.h" #include "user_interface.h" #include "common-hal/microcontroller/Pin.h" +#include "common-hal/nativeio/PWMOut.h" STATIC char heap[36 * 1024]; @@ -63,6 +64,7 @@ STATIC void mp_reset(void) { pin_init0(); readline_init0(); dupterm_task_init(); + pwmout_reset(); #if MICROPY_MODULE_FROZEN pyexec_frozen_module("_boot.py"); pyexec_file("boot.py", NULL); |
