Skip to content

Commit

Permalink
Swap WDT timeout to milliseconds in haltError to match Arch differere…
Browse files Browse the repository at this point in the history
…nces
  • Loading branch information
tyeth committed Dec 19, 2024
1 parent 04dbf36 commit fac995a
Showing 1 changed file with 5 additions and 3 deletions.
8 changes: 5 additions & 3 deletions src/Wippersnapper.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -2501,8 +2501,10 @@ void Wippersnapper::runNetFSM() {
/**************************************************************************/
void Wippersnapper::haltError(String error, ws_led_status_t ledStatusColor,
uint8_t seconds_until_reboot) {
uint8_t wdt_timeout = 5; // future platform-specific differences
int seconds_until_wdt_enable = seconds_until_reboot - wdt_timeout;
uint8_t wdt_timeout_ms = 5000; // future platform-specific differences
int seconds_until_wdt_enable =
seconds_until_reboot - (int)(wdt_timeout_ms / 1000);

for (int i = 0;; i++) {
WS_DEBUG_PRINT("ERROR [WDT RESET IN ");
WS_DEBUG_PRINT(seconds_until_reboot - i);
Expand All @@ -2521,7 +2523,7 @@ void Wippersnapper::haltError(String error, ws_led_status_t ledStatusColor,
yield();
WS.feedWDT(); // feed the WDT for the first 20 seconds
} else if (i == seconds_until_reboot) {
WS.enableWDT(wdt_timeout * 1000);
WS.enableWDT(wdt_timeout_ms);
}
}
}
Expand Down

0 comments on commit fac995a

Please sign in to comment.