mirror of
https://github.com/arendst/Tasmota.git
synced 2025-07-27 20:56:35 +00:00
Add command `Restart 2
` to halt system
Add command ``Restart 2`` to halt system. Needs hardware reset or power cycle to restart (#9046)
This commit is contained in:
parent
94fb9392a1
commit
f268697e54
@ -58,3 +58,5 @@ The following binary downloads have been compiled with ESP8266/Arduino library c
|
|||||||
- Fix ESP32 PWM range
|
- Fix ESP32 PWM range
|
||||||
- Add Zigbee better support for IKEA Motion Sensor
|
- Add Zigbee better support for IKEA Motion Sensor
|
||||||
- Add ESP32 Analog input support for GPIO32 to GPIO39
|
- Add ESP32 Analog input support for GPIO32 to GPIO39
|
||||||
|
- Add Zigbee options to ``ZbSend`` ``Config`` and ``ReadCondig``
|
||||||
|
- Add command ``Restart 2`` to halt system. Needs hardware reset or power cycle to restart (#9046)
|
||||||
|
@ -5,7 +5,8 @@
|
|||||||
- Fix ESP32 PWM range
|
- Fix ESP32 PWM range
|
||||||
- Add Zigbee better support for IKEA Motion Sensor
|
- Add Zigbee better support for IKEA Motion Sensor
|
||||||
- Add ESP32 Analog input support for GPIO32 to GPIO39
|
- Add ESP32 Analog input support for GPIO32 to GPIO39
|
||||||
- Add Zigbee add options to ``ZbSend`` ``Config`` and ``ReadCondig``
|
- Add Zigbee options to ``ZbSend`` ``Config`` and ``ReadCondig``
|
||||||
|
- Add command ``Restart 2`` to halt system. Needs hardware reset or power cycle to restart (#9046)
|
||||||
|
|
||||||
### 8.4.0 20200730
|
### 8.4.0 20200730
|
||||||
|
|
||||||
|
@ -81,6 +81,7 @@
|
|||||||
#define D_JSON_GAS "Gas"
|
#define D_JSON_GAS "Gas"
|
||||||
#define D_JSON_GATEWAY "Gateway"
|
#define D_JSON_GATEWAY "Gateway"
|
||||||
#define D_JSON_GROUPS "Groups"
|
#define D_JSON_GROUPS "Groups"
|
||||||
|
#define D_JSON_HALTING "Halting"
|
||||||
#define D_JSON_HEAPSIZE "Heap"
|
#define D_JSON_HEAPSIZE "Heap"
|
||||||
#define D_JSON_HIGH "High"
|
#define D_JSON_HIGH "High"
|
||||||
#define D_JSON_HOST_NOT_FOUND "Host not found"
|
#define D_JSON_HOST_NOT_FOUND "Host not found"
|
||||||
@ -286,7 +287,7 @@
|
|||||||
#define D_CMND_INTERLOCK "Interlock"
|
#define D_CMND_INTERLOCK "Interlock"
|
||||||
#define D_CMND_TELEPERIOD "TelePeriod"
|
#define D_CMND_TELEPERIOD "TelePeriod"
|
||||||
#define D_CMND_RESTART "Restart"
|
#define D_CMND_RESTART "Restart"
|
||||||
#define D_JSON_ONE_TO_RESTART "1 to restart"
|
#define D_JSON_ONE_TO_RESTART "1 to restart, 2 to halt"
|
||||||
#define D_CMND_RESET "Reset"
|
#define D_CMND_RESET "Reset"
|
||||||
#define D_JSON_RESET_AND_RESTARTING "Reset and Restarting"
|
#define D_JSON_RESET_AND_RESTARTING "Reset and Restarting"
|
||||||
#define D_JSON_ONE_TO_RESET "1 to reset"
|
#define D_JSON_ONE_TO_RESET "1 to reset"
|
||||||
|
@ -695,6 +695,11 @@ void CmndRestart(void)
|
|||||||
restart_flag = 2;
|
restart_flag = 2;
|
||||||
ResponseCmndChar(D_JSON_RESTARTING);
|
ResponseCmndChar(D_JSON_RESTARTING);
|
||||||
break;
|
break;
|
||||||
|
case 2:
|
||||||
|
restart_flag = 2;
|
||||||
|
restart_halt = true;
|
||||||
|
ResponseCmndChar(D_JSON_HALTING);
|
||||||
|
break;
|
||||||
case -1:
|
case -1:
|
||||||
CmndCrash(); // force a crash
|
CmndCrash(); // force a crash
|
||||||
break;
|
break;
|
||||||
|
@ -1143,7 +1143,7 @@ void Every250mSeconds(void)
|
|||||||
}
|
}
|
||||||
restart_flag--;
|
restart_flag--;
|
||||||
if (restart_flag <= 0) {
|
if (restart_flag <= 0) {
|
||||||
AddLog_P(LOG_LEVEL_INFO, PSTR(D_LOG_APPLICATION D_RESTARTING));
|
AddLog_P2(LOG_LEVEL_INFO, PSTR(D_LOG_APPLICATION "%s"), (restart_halt) ? "Halted" : D_RESTARTING);
|
||||||
EspRestart();
|
EspRestart();
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
@ -640,7 +640,18 @@ void EspRestart(void)
|
|||||||
ResetPwm();
|
ResetPwm();
|
||||||
WifiShutdown(true);
|
WifiShutdown(true);
|
||||||
CrashDumpClear(); // Clear the stack dump in RTC
|
CrashDumpClear(); // Clear the stack dump in RTC
|
||||||
ESP_Restart();
|
|
||||||
|
if (restart_halt) {
|
||||||
|
while (1) {
|
||||||
|
OsWatchLoop(); // Feed OsWatch timer to prevent restart
|
||||||
|
SetLedLink(1); // Wifi led on
|
||||||
|
delay(200); // Satisfy SDK
|
||||||
|
SetLedLink(0); // Wifi led off
|
||||||
|
delay(800); // Satisfy SDK
|
||||||
|
}
|
||||||
|
} else {
|
||||||
|
ESP_Restart();
|
||||||
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
//
|
//
|
||||||
|
@ -168,6 +168,7 @@ bool soft_spi_flg = false; // Software SPI configured
|
|||||||
bool ntp_force_sync = false; // Force NTP sync
|
bool ntp_force_sync = false; // Force NTP sync
|
||||||
bool is_8285 = false; // Hardware device ESP8266EX (0) or ESP8285 (1)
|
bool is_8285 = false; // Hardware device ESP8266EX (0) or ESP8285 (1)
|
||||||
bool skip_light_fade; // Temporarily skip light fading
|
bool skip_light_fade; // Temporarily skip light fading
|
||||||
|
bool restart_halt = false; // Do not restart but stay in wait loop
|
||||||
myio my_module; // Active copy of Module GPIOs (17 x 8 bits)
|
myio my_module; // Active copy of Module GPIOs (17 x 8 bits)
|
||||||
gpio_flag my_module_flag; // Active copy of Template GPIO flags
|
gpio_flag my_module_flag; // Active copy of Template GPIO flags
|
||||||
StateBitfield global_state; // Global states (currently Wifi and Mqtt) (8 bits)
|
StateBitfield global_state; // Global states (currently Wifi and Mqtt) (8 bits)
|
||||||
|
Loading…
x
Reference in New Issue
Block a user