Add autoexec failsafe

This commit is contained in:
Theo Arends 2021-02-15 16:51:13 +01:00
parent 68baafc685
commit 3c623b5233
2 changed files with 3 additions and 1 deletions

View File

@ -146,6 +146,7 @@ struct {
bool restart_halt; // Do not restart but stay in wait loop
bool module_changed; // Indicate module changed since last restart
bool wifi_stay_asleep; // Allow sleep only incase of ESP32 BLE
bool no_autoexec; // Disable autoexec
StateBitfield global_state; // Global states (currently Wifi and Mqtt) (8 bits)
uint8_t spi_enabled; // SPI configured
@ -303,6 +304,7 @@ void setup(void) {
}
if (RtcReboot.fast_reboot_count > Settings.param[P_BOOT_LOOP_OFFSET] +2) { // Restarted 4 times
Settings.rule_enabled = 0; // Disable all rules
TasmotaGlobal.no_autoexec = true;
}
if (RtcReboot.fast_reboot_count > Settings.param[P_BOOT_LOOP_OFFSET] +3) { // Restarted 5 times
for (uint32_t i = 0; i < ARRAY_SIZE(Settings.my_gp.io); i++) {

View File

@ -798,7 +798,7 @@ bool Xdrv50(uint8_t function) {
if (UfsData.autoexec) {
// Safe to execute autoexec commands here
UfsData.autoexec = false;
UfsAutoexec();
if (!TasmotaGlobal.no_autoexec) { UfsAutoexec(); }
}
break;
case FUNC_MQTT_INIT: