diff options
| author | Daniel Campora <daniel@wipy.io> | 2015-05-26 16:06:41 +0200 |
|---|---|---|
| committer | Daniel Campora <daniel@wipy.io> | 2015-05-27 09:45:22 +0200 |
| commit | 5a0c5f8fea921bdc58c895028c032a3c4d9ebcbb (patch) | |
| tree | d28ff3ced86bcff8ed31d1878861139ef5973837 | |
| parent | ec1f0e7551db1d3e19ce319ca9ba79b55ef5f2b4 (diff) | |
cc3200: Use the WDT stall feature in debug mode only.
| -rw-r--r-- | cc3200/mods/pybwdt.c | 6 |
1 files changed, 4 insertions, 2 deletions
diff --git a/cc3200/mods/pybwdt.c b/cc3200/mods/pybwdt.c index 9770a7c47..c6c5cae68 100644 --- a/cc3200/mods/pybwdt.c +++ b/cc3200/mods/pybwdt.c @@ -114,15 +114,17 @@ STATIC mp_obj_t pyb_enable_wdt(mp_obj_t self, mp_obj_t msec_in) { // Unlock to be able to configure the registers MAP_WatchdogUnlock(WDT_BASE); +#ifdef DEBUG // make the WDT stall when the debugger stops on a breakpoint MAP_WatchdogStallEnable (WDT_BASE); +#endif // set the watchdog timer reload value // the WDT trigger a system reset after the second timeout - // so, divide by the 2 timeout value received + // so, divide by 2 the timeout value received MAP_WatchdogReloadSet(WDT_BASE, PYBWDT_MILLISECONDS_TO_TICKS(msec / 2)); - // start the timer. Once wdt is started, it cannot be disabled. + // start the timer. Once it's started, it cannot be disabled. MAP_WatchdogEnable(WDT_BASE); pybwdt_data.running = true; |
