![](/media/cache/profiles/8631e5b91354a846f00dbbf16ad94259.jpg.50x50_q85.jpg)
Example of watchdog with poor coverage
Fork of Watchdog_sample_fail by
Diff: main.cpp
- Revision:
- 2:c31a1758ac38
- Parent:
- 1:159a09ac60ba
- Child:
- 3:32a940251192
--- a/main.cpp Tue Feb 28 17:39:50 2017 +0000 +++ b/main.cpp Tue Feb 28 18:05:25 2017 +0000 @@ -1,8 +1,13 @@ #include "mbed.h" #include "wdt.h" -//WATCHDOG ENABLED (overloading library function SystemInit.c) -// +// Sample program using the Watchdog +// --------------------------------- +// * Watchdog is fed for 5 sec, after that +// * ... the system resets + +// Note on how the WATCHDOG is enabled, overloading library function SystemInit +// - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - // The KL25Z watchdog is enabled after reset with timeout=1024ms (2^10*LPO=1KHz) // To make the dvice easy to use on mbed, th watchdog is disabled at startup // (in file SystemInit.c) **BUT** SIM_COPC register can only be written once @@ -18,6 +23,7 @@ // https://developer.mbed.org/users/chris/notebook/Patching-functions-and-libraries/ // and searching "ARM Compiler toolchain Using the Linker" // "Using $Super$$ and $Sub$$ to patch symbol definitions" +// - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - #define LIGHT 0