Skip to content

Commit

Permalink
Add FUNC_ABOUT_TO_RESTART (arendst#21460)
Browse files Browse the repository at this point in the history
  • Loading branch information
arendst committed May 21, 2024
1 parent 73350da commit 3b4035b
Show file tree
Hide file tree
Showing 3 changed files with 4 additions and 1 deletion.
2 changes: 1 addition & 1 deletion tasmota/include/tasmota.h
Original file line number Diff line number Diff line change
Expand Up @@ -416,7 +416,7 @@ enum LightSubtypes { LST_NONE, LST_SINGLE, LST_COLDWARM, LST_RGB, LST_RGBW, LS
enum LightTypes { LT_BASIC, LT_PWM1, LT_PWM2, LT_PWM3, LT_PWM4, LT_PWM5, LT_PWM6, LT_PWM7,
LT_NU8, LT_SERIAL1, LT_SERIAL2, LT_RGB, LT_RGBW, LT_RGBWC, LT_NU14, LT_NU15 }; // Do not insert new fields

enum XsnsFunctions { FUNC_SETTINGS_OVERRIDE, FUNC_SETUP_RING1, FUNC_SETUP_RING2, FUNC_PRE_INIT, FUNC_INIT, FUNC_ACTIVE,
enum XsnsFunctions { FUNC_SETTINGS_OVERRIDE, FUNC_SETUP_RING1, FUNC_SETUP_RING2, FUNC_PRE_INIT, FUNC_INIT, FUNC_ACTIVE, FUNC_ABOUT_TO_RESTART,
FUNC_LOOP, FUNC_SLEEP_LOOP, FUNC_EVERY_50_MSECOND, FUNC_EVERY_100_MSECOND, FUNC_EVERY_200_MSECOND, FUNC_EVERY_250_MSECOND, FUNC_EVERY_SECOND,
FUNC_RESET_SETTINGS, FUNC_RESTORE_SETTINGS, FUNC_SAVE_SETTINGS, FUNC_SAVE_AT_MIDNIGHT, FUNC_SAVE_BEFORE_RESTART, FUNC_INTERRUPT_STOP, FUNC_INTERRUPT_START,
FUNC_AFTER_TELEPERIOD, FUNC_JSON_APPEND, FUNC_WEB_SENSOR, FUNC_WEB_COL_SENSOR,
Expand Down
2 changes: 2 additions & 0 deletions tasmota/tasmota_support/support_tasmota.ino
Original file line number Diff line number Diff line change
Expand Up @@ -1436,6 +1436,7 @@ void Every250mSeconds(void)
OtaFactoryWrite(true);
#endif
RtcSettings.ota_loader = 1; // Try safeboot image next
XsnsXdrvCall(FUNC_ABOUT_TO_RESTART);
SettingsSaveAll();
AddLog(LOG_LEVEL_INFO, PSTR(D_LOG_APPLICATION D_RESTARTING));
EspPrepRestartToSafeBoot();
Expand Down Expand Up @@ -1583,6 +1584,7 @@ void Every250mSeconds(void)
}

if (2 == TasmotaGlobal.restart_flag) { // Restart 1
XsnsXdrvCall(FUNC_ABOUT_TO_RESTART);
SettingsSaveAll();
}

Expand Down
1 change: 1 addition & 0 deletions tasmota/tasmota_xdrv_driver/xdrv_01_9_webserver.ino
Original file line number Diff line number Diff line change
Expand Up @@ -3112,6 +3112,7 @@ void HandleSwitchBootPartition(void)

// apply the change in flash and return result
if (switch_factory || switch_ota) {
XsnsXdrvCall(FUNC_ABOUT_TO_RESTART);
SettingsSaveAll();
if (switch_factory) {
EspPrepRestartToSafeBoot();
Expand Down

0 comments on commit 3b4035b

Please sign in to comment.