![](/media/cache/profiles/8631e5b91354a846f00dbbf16ad94259.jpg.50x50_q85.jpg)
Example of watchdog with poor coverage
Fork of Watchdog_sample_fail by
Diff: main.cpp
- Revision:
- 7:e49685bca7c7
- Parent:
- 6:8b0ca28c88a4
diff -r 8b0ca28c88a4 -r e49685bca7c7 main.cpp --- a/main.cpp Wed Feb 27 15:54:07 2019 +0000 +++ b/main.cpp Wed Mar 11 08:46:57 2020 +0000 @@ -70,9 +70,9 @@ // ----------------------------------------------- void timer_thread() { // method to run in thread while (true) { - wait(1.0) ; + ThisThread::sleep_for(1000) ; signals.set(ON1 | ON2) ; - wait(1.0) ; + ThisThread::sleep_for(1000) ; signals.set(OFF1 | OFF2) ; // waitButton() ; // POSSIBLE FAULT HERE } @@ -98,7 +98,11 @@ // show start-up led_red = OFF; - wait(5.0) ; + ThisThread::sleep_for(5000) ; led_red = ON; - // main thread terminates + + // main thread does nothing more + while (true) { + ThisThread::sleep_for(10000) ; + } } \ No newline at end of file