@@ -1673,9 +1673,7 @@ void cbErrorTopic(char *errorData, uint16_t len) {
1673
1673
#endif
1674
1674
1675
1675
// WDT reset
1676
- for (;;) {
1677
- delay (100 );
1678
- }
1676
+ WS.haltError (" IO MQTT Ban Error" );
1679
1677
}
1680
1678
1681
1679
/* *************************************************************************/
@@ -2468,17 +2466,17 @@ void Wippersnapper::runNetFSM() {
2468
2466
*/
2469
2467
/* *************************************************************************/
2470
2468
void Wippersnapper::haltError (String error, ws_led_status_t ledStatusColor) {
2471
- WS_DEBUG_PRINT (" ERROR [WDT RESET]: " );
2472
- WS_DEBUG_PRINTLN (error);
2473
2469
for (;;) {
2470
+ WS_DEBUG_PRINT (" ERROR [WDT RESET]: " );
2471
+ WS_DEBUG_PRINTLN (error);
2474
2472
// let the WDT fail out and reset!
2475
2473
statusLEDSolid (ledStatusColor);
2476
2474
#ifndef ARDUINO_ARCH_ESP8266
2477
- delay (100 );
2475
+ delay (1000 );
2478
2476
#else
2479
2477
// Calls to delay() and yield() feed the ESP8266's
2480
2478
// hardware and software watchdog timers, delayMicroseconds does not.
2481
- delayMicroseconds (100 );
2479
+ delayMicroseconds (1000 );
2482
2480
#endif
2483
2481
}
2484
2482
}
@@ -2562,11 +2560,7 @@ void Wippersnapper::enableWDT(int timeoutMS) {
2562
2560
Watchdog.disable ();
2563
2561
#endif
2564
2562
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!" );
2570
2564
}
2571
2565
}
2572
2566
0 commit comments