diff --git a/ESPMegaPRO-OS-SDK/lib/ESPMegaPRO/ESPMegaRecovery.cpp b/ESPMegaPRO-OS-SDK/lib/ESPMegaPRO/ESPMegaRecovery.cpp index f9343a3..863b194 100644 --- a/ESPMegaPRO-OS-SDK/lib/ESPMegaPRO/ESPMegaRecovery.cpp +++ b/ESPMegaPRO-OS-SDK/lib/ESPMegaPRO/ESPMegaRecovery.cpp @@ -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