Skip to content

Commit fac995a

Browse files
committed
Swap WDT timeout to milliseconds in haltError to match Arch differerences
1 parent 04dbf36 commit fac995a

File tree

1 file changed

+5
-3
lines changed

1 file changed

+5
-3
lines changed

src/Wippersnapper.cpp

Lines changed: 5 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -2501,8 +2501,10 @@ void Wippersnapper::runNetFSM() {
25012501
/**************************************************************************/
25022502
void Wippersnapper::haltError(String error, ws_led_status_t ledStatusColor,
25032503
uint8_t seconds_until_reboot) {
2504-
uint8_t wdt_timeout = 5; // future platform-specific differences
2505-
int seconds_until_wdt_enable = seconds_until_reboot - wdt_timeout;
2504+
uint8_t wdt_timeout_ms = 5000; // future platform-specific differences
2505+
int seconds_until_wdt_enable =
2506+
seconds_until_reboot - (int)(wdt_timeout_ms / 1000);
2507+
25062508
for (int i = 0;; i++) {
25072509
WS_DEBUG_PRINT("ERROR [WDT RESET IN ");
25082510
WS_DEBUG_PRINT(seconds_until_reboot - i);
@@ -2521,7 +2523,7 @@ void Wippersnapper::haltError(String error, ws_led_status_t ledStatusColor,
25212523
yield();
25222524
WS.feedWDT(); // feed the WDT for the first 20 seconds
25232525
} else if (i == seconds_until_reboot) {
2524-
WS.enableWDT(wdt_timeout * 1000);
2526+
WS.enableWDT(wdt_timeout_ms);
25252527
}
25262528
}
25272529
}

0 commit comments

Comments
 (0)