Skip to content

Commit 9bf5dc4

Browse files
authored
Merge pull request #570 from adafruit/deviceid_generation_failure_fshalt
fsHalt message improvements
2 parents 5efdd64 + 8298485 commit 9bf5dc4

File tree

1 file changed

+6
-12
lines changed

1 file changed

+6
-12
lines changed

src/Wippersnapper.cpp

Lines changed: 6 additions & 12 deletions
Original file line numberDiff line numberDiff line change
@@ -1673,9 +1673,7 @@ void cbErrorTopic(char *errorData, uint16_t len) {
16731673
#endif
16741674

16751675
// WDT reset
1676-
for (;;) {
1677-
delay(100);
1678-
}
1676+
WS.haltError("IO MQTT Ban Error");
16791677
}
16801678

16811679
/**************************************************************************/
@@ -2468,17 +2466,17 @@ void Wippersnapper::runNetFSM() {
24682466
*/
24692467
/**************************************************************************/
24702468
void Wippersnapper::haltError(String error, ws_led_status_t ledStatusColor) {
2471-
WS_DEBUG_PRINT("ERROR [WDT RESET]: ");
2472-
WS_DEBUG_PRINTLN(error);
24732469
for (;;) {
2470+
WS_DEBUG_PRINT("ERROR [WDT RESET]: ");
2471+
WS_DEBUG_PRINTLN(error);
24742472
// let the WDT fail out and reset!
24752473
statusLEDSolid(ledStatusColor);
24762474
#ifndef ARDUINO_ARCH_ESP8266
2477-
delay(100);
2475+
delay(1000);
24782476
#else
24792477
// Calls to delay() and yield() feed the ESP8266's
24802478
// hardware and software watchdog timers, delayMicroseconds does not.
2481-
delayMicroseconds(100);
2479+
delayMicroseconds(1000);
24822480
#endif
24832481
}
24842482
}
@@ -2562,11 +2560,7 @@ void Wippersnapper::enableWDT(int timeoutMS) {
25622560
Watchdog.disable();
25632561
#endif
25642562
if (Watchdog.enable(timeoutMS) == 0) {
2565-
WS_DEBUG_PRINTLN("ERROR: WDT initialization failure!");
2566-
setStatusLEDColor(LED_ERROR);
2567-
for (;;) {
2568-
delay(100);
2569-
}
2563+
WS.haltError("WDT initialization failure!");
25702564
}
25712565
}
25722566

0 commit comments

Comments
 (0)