From b594a3b872961c2627423aac1595faa0d017e388 Mon Sep 17 00:00:00 2001 From: tyeth Date: Thu, 19 Dec 2024 18:25:55 +0000 Subject: [PATCH] Add custom WDT timeout for ESP8266 --- src/Wippersnapper.cpp | 8 ++++++-- 1 file changed, 6 insertions(+), 2 deletions(-) diff --git a/src/Wippersnapper.cpp b/src/Wippersnapper.cpp index 3c222a21..7488787a 100644 --- a/src/Wippersnapper.cpp +++ b/src/Wippersnapper.cpp @@ -2503,7 +2503,11 @@ void Wippersnapper::runNetFSM() { /**************************************************************************/ void Wippersnapper::haltError(String error, ws_led_status_t ledStatusColor, uint8_t seconds_until_reboot) { - uint8_t wdt_timeout_ms = 5000; // future platform-specific differences +#ifdef ARDUINO_ARCH_ESP8266 + uint8_t wdt_timeout_ms = 3200; +#else + uint8_t wdt_timeout_ms = 5000; +#endif int seconds_until_wdt_enable = seconds_until_reboot - (int)(wdt_timeout_ms / 1000); @@ -2523,7 +2527,7 @@ void Wippersnapper::haltError(String error, ws_led_status_t ledStatusColor, #endif if (i < seconds_until_wdt_enable) { yield(); - WS.feedWDT(); // feed the WDT for the first 20 seconds + WS.feedWDT(); // feed the WDT for the first X-5 seconds } else if (i == seconds_until_reboot) { WS.enableWDT(wdt_timeout_ms); }