watchdog timer

This commit is contained in:
Siwat Sirichai 2024-02-14 16:32:49 +07:00
parent 87f0ee073b
commit ca0ee31e95
1 changed files with 9 additions and 0 deletions

View File

@ -28,6 +28,15 @@ void ESPMegaRecovery::loop() {
delay(1000);
}
}
// Watchdog timer
static bool booted = false;
static uint32_t boot_time = millis();
if(!booted) {
if(millis() - boot_time > RECOVERY_WATCHDOG_TIMEOUT * 1000) {
this->resetBootloopCounter();
booted = true;
}
}
}
void ESPMegaRecovery::enterRecoveryMode() {
// Set the recovery mode flag