mirror of
https://github.com/arendst/Tasmota.git
synced 2025-07-21 01:36:31 +00:00
Add ESP32 switch to safeboot on 10 fast_reboots
This commit is contained in:
parent
46e6f7ea02
commit
4efc2d6ce6
@ -644,6 +644,17 @@ void setup(void) {
|
|||||||
// Settings->last_module = Settings->fallback_module;
|
// Settings->last_module = Settings->fallback_module;
|
||||||
}
|
}
|
||||||
AddLog(LOG_LEVEL_INFO, PSTR("FRC: " D_LOG_SOME_SETTINGS_RESET " (%d)"), RtcReboot.fast_reboot_count);
|
AddLog(LOG_LEVEL_INFO, PSTR("FRC: " D_LOG_SOME_SETTINGS_RESET " (%d)"), RtcReboot.fast_reboot_count);
|
||||||
|
#ifdef ESP32
|
||||||
|
#ifndef FIRMWARE_MINIMAL
|
||||||
|
if (RtcReboot.fast_reboot_count > Settings->param[P_BOOT_LOOP_OFFSET] +8) { // Restarted 10 times
|
||||||
|
if (EspPrepSwitchPartition(0)) { // Switch to safeboot
|
||||||
|
RtcReboot.fast_reboot_count = 0; // Reset for next user restart
|
||||||
|
RtcRebootSave();
|
||||||
|
EspRestart(); // Restart in safeboot mode
|
||||||
|
}
|
||||||
|
}
|
||||||
|
#endif // FIRMWARE_MINIMAL
|
||||||
|
#endif // ESP32
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
|
Loading…
x
Reference in New Issue
Block a user