Skip to content

Commit b594a3b

Browse files
committed
Add custom WDT timeout for ESP8266
1 parent f87a208 commit b594a3b

File tree

1 file changed

+6
-2
lines changed

1 file changed

+6
-2
lines changed

src/Wippersnapper.cpp

Lines changed: 6 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -2503,7 +2503,11 @@ void Wippersnapper::runNetFSM() {
25032503
/**************************************************************************/
25042504
void Wippersnapper::haltError(String error, ws_led_status_t ledStatusColor,
25052505
uint8_t seconds_until_reboot) {
2506-
uint8_t wdt_timeout_ms = 5000; // future platform-specific differences
2506+
#ifdef ARDUINO_ARCH_ESP8266
2507+
uint8_t wdt_timeout_ms = 3200;
2508+
#else
2509+
uint8_t wdt_timeout_ms = 5000;
2510+
#endif
25072511
int seconds_until_wdt_enable =
25082512
seconds_until_reboot - (int)(wdt_timeout_ms / 1000);
25092513

@@ -2523,7 +2527,7 @@ void Wippersnapper::haltError(String error, ws_led_status_t ledStatusColor,
25232527
#endif
25242528
if (i < seconds_until_wdt_enable) {
25252529
yield();
2526-
WS.feedWDT(); // feed the WDT for the first 20 seconds
2530+
WS.feedWDT(); // feed the WDT for the first X-5 seconds
25272531
} else if (i == seconds_until_reboot) {
25282532
WS.enableWDT(wdt_timeout_ms);
25292533
}

0 commit comments

Comments
 (0)