diff --git a/tasmota/settings.ino b/tasmota/settings.ino index ae442069b..fe362179b 100644 --- a/tasmota/settings.ino +++ b/tasmota/settings.ino @@ -231,6 +231,12 @@ void RtcRebootSave(void) } } +void RtcRebootReset(void) +{ + RtcReboot.fast_reboot_count = 0; + RtcRebootSave(); +} + void RtcRebootLoad(void) { ESP.rtcUserMemoryRead(100 - sizeof(RTCRBT), (uint32_t*)&RtcReboot, sizeof(RTCRBT)); // 0x280 @@ -1148,6 +1154,7 @@ void SettingsDelta(void) if (Settings.version < 0x07000004) { Settings.wifi_output_power = 170; } + Settings.version = VERSION; SettingsSave(1); } diff --git a/tasmota/support_wifi.ino b/tasmota/support_wifi.ino index f90d7cff1..4451047bd 100644 --- a/tasmota/support_wifi.ino +++ b/tasmota/support_wifi.ino @@ -615,6 +615,7 @@ void WifiShutdown(void) void EspRestart(void) { WifiShutdown(); + RtcRebootReset(); // ESP.restart(); // This results in exception 3 on restarts on core 2.3.0 ESP.reset(); } diff --git a/tasmota/tasmota.ino b/tasmota/tasmota.ino index 2f7979ccb..4d50d9cf7 100644 --- a/tasmota/tasmota.ino +++ b/tasmota/tasmota.ino @@ -816,8 +816,7 @@ void PerformEverySecond(void) } if (BOOT_LOOP_TIME == uptime) { - RtcReboot.fast_reboot_count = 0; - RtcRebootSave(); + RtcRebootReset(); #ifdef USE_DEEPSLEEP if (!(DeepSleepEnabled() && !Settings.flag3.bootcount_update)) { diff --git a/tasmota/xdrv_29_deepsleep.ino b/tasmota/xdrv_29_deepsleep.ino index 6afc247ff..11987518c 100644 --- a/tasmota/xdrv_29_deepsleep.ino +++ b/tasmota/xdrv_29_deepsleep.ino @@ -62,8 +62,7 @@ bool DeepSleepEnabled(void) void DeepSleepInit(void) { if (DeepSleepEnabled()) { - RtcReboot.fast_reboot_count = 0; - RtcRebootSave(); + RtcRebootReset(); if ((RtcSettings.ultradeepsleep > MAX_DEEPSLEEP_CYCLE) && (RtcSettings.ultradeepsleep < 1700000000)) { // Go back to sleep after 60 minutes if requested deepsleep has not been reached RtcSettings.ultradeepsleep = RtcSettings.ultradeepsleep - MAX_DEEPSLEEP_CYCLE;