diff options
| author | Daniel Campora <daniel@wipy.io> | 2015-05-09 17:46:16 +0200 |
|---|---|---|
| committer | Daniel Campora <daniel@wipy.io> | 2015-05-17 12:34:49 +0200 |
| commit | 8e611e841476d98eb829978a7e73ce92ff822ca8 (patch) | |
| tree | 7881c41feb3a5c5ecd98b1a65da5c0bc56d3382f /cc3200/mptask.c | |
| parent | 9466e154b4806ace535d4493d1dd6e63379c2f68 (diff) | |
cc3200: Add Timer module. Supports free running, PWM and capture modes.
Diffstat (limited to 'cc3200/mptask.c')
| -rw-r--r-- | cc3200/mptask.c | 12 |
1 files changed, 11 insertions, 1 deletions
diff --git a/cc3200/mptask.c b/cc3200/mptask.c index 4c077107f..28dde5185 100644 --- a/cc3200/mptask.c +++ b/cc3200/mptask.c @@ -63,6 +63,7 @@ #include "pybsd.h" #include "pins.h" #include "pybsleep.h" +#include "pybtimer.h" #include "mpcallback.h" /****************************************************************************** @@ -124,6 +125,7 @@ soft_reset: mperror_init0(); uart_init0(); pin_init0(); + timer_init0(); readline_init0(); mod_network_init0(); #if MICROPY_HW_ENABLE_RNG @@ -242,15 +244,23 @@ soft_reset_exit: // soft reset pybsleep_signal_soft_reset(); - mp_printf(&mp_plat_print, "PYB: soft reboot\n"); + // disable all peripherals that could trigger a callback + pyb_rtc_callback_disable(NULL); + timer_disable_all(); + uart_disable_all(); + + // flush the serial flash buffer sflash_disk_flush(); #if MICROPY_HW_HAS_SDCARD pybsd_deinit(); #endif + // wait for pending transactions to complete + HAL_Delay(20); + goto soft_reset; } |
