newest
Dependencies: BME280 BMP280 TextLCD mbed
Fork of CW_watchdog_08012018_newest by
Diff: main.cpp
- Revision:
- 3:f5fe5071416a
- Parent:
- 2:c696dfd53eeb
- Child:
- 4:5dbb5145d0a9
--- a/main.cpp Tue Jan 09 11:26:15 2018 +0000 +++ b/main.cpp Tue Jan 09 11:54:56 2018 +0000 @@ -2,8 +2,9 @@ #include "TextLCD.h" #include "BME280.h" #include "putty.h" +#define watchdog_time 15 //DigitalOut myled(LED1); -int dislcd = 0; +int dislcd = 0, wdcounter = 0, watchdog = 0; float T = 15; Ticker display; Ticker second_pass; @@ -17,6 +18,10 @@ void second_tick() { ss++; + if(watchdog == 1) + { + wdcounter++; + } time_rule(); day_check(); lcd.cls(); @@ -35,8 +40,10 @@ display_dates(); display_time(); } - - //VIC_SystemReset(); + if (wdcounter >= watchdog_time) + { + NVIC_SystemReset(); + } } void lcddisp()