mirror of https://github.com/arendst/Tasmota.git
Change from `Crash` to `Restart -1`
This commit is contained in:
parent
5a0febc64e
commit
7796714ba0
|
@ -293,8 +293,6 @@
|
||||||
#define D_JSON_FLAG "FLAG"
|
#define D_JSON_FLAG "FLAG"
|
||||||
#define D_JSON_BASE "BASE"
|
#define D_JSON_BASE "BASE"
|
||||||
#define D_CMND_TEMPOFFSET "TempOffset"
|
#define D_CMND_TEMPOFFSET "TempOffset"
|
||||||
#define D_CMND_CRASH "Crash"
|
|
||||||
#define D_JSON_ONE_TO_CRASH "1 to crash"
|
|
||||||
|
|
||||||
// Commands xdrv_01_mqtt.ino
|
// Commands xdrv_01_mqtt.ino
|
||||||
#define D_CMND_MQTTLOG "MqttLog"
|
#define D_CMND_MQTTLOG "MqttLog"
|
||||||
|
|
|
@ -268,9 +268,6 @@
|
||||||
//#define MY_LANGUAGE zh-CN // Chinese (Simplified) in China
|
//#define MY_LANGUAGE zh-CN // Chinese (Simplified) in China
|
||||||
//#define MY_LANGUAGE zh-TW // Chinese (Traditional) in Taiwan
|
//#define MY_LANGUAGE zh-TW // Chinese (Traditional) in Taiwan
|
||||||
|
|
||||||
// -- Crash generator ---------------------------
|
|
||||||
//#define USE_CRASH // add a `Crash` command to test the crash recorder (+48 bytes)
|
|
||||||
|
|
||||||
// -- Wifi Config tools ---------------------------
|
// -- Wifi Config tools ---------------------------
|
||||||
#define WIFI_SOFT_AP_CHANNEL 1 // Soft Access Point Channel number between 1 and 13 as used by Wifi Manager web GUI
|
#define WIFI_SOFT_AP_CHANNEL 1 // Soft Access Point Channel number between 1 and 13 as used by Wifi Manager web GUI
|
||||||
|
|
||||||
|
|
|
@ -29,9 +29,6 @@ const char kTasmotaCommands[] PROGMEM = "|" // No prefix
|
||||||
D_CMND_TIMEDST "|" D_CMND_ALTITUDE "|" D_CMND_LEDPOWER "|" D_CMND_LEDSTATE "|" D_CMND_LEDMASK "|" D_CMND_WIFIPOWER "|" D_CMND_TEMPOFFSET "|"
|
D_CMND_TIMEDST "|" D_CMND_ALTITUDE "|" D_CMND_LEDPOWER "|" D_CMND_LEDSTATE "|" D_CMND_LEDMASK "|" D_CMND_WIFIPOWER "|" D_CMND_TEMPOFFSET "|"
|
||||||
#ifdef USE_I2C
|
#ifdef USE_I2C
|
||||||
D_CMND_I2CSCAN "|" D_CMND_I2CDRIVER "|"
|
D_CMND_I2CSCAN "|" D_CMND_I2CDRIVER "|"
|
||||||
#endif
|
|
||||||
#ifdef USE_CRASH
|
|
||||||
D_CMND_CRASH "|"
|
|
||||||
#endif
|
#endif
|
||||||
D_CMND_SENSOR "|" D_CMND_DRIVER ;
|
D_CMND_SENSOR "|" D_CMND_DRIVER ;
|
||||||
|
|
||||||
|
@ -47,9 +44,6 @@ void (* const TasmotaCommand[])(void) PROGMEM = {
|
||||||
&CmndTimeDst, &CmndAltitude, &CmndLedPower, &CmndLedState, &CmndLedMask, &CmndWifiPower, &CmndTempOffset,
|
&CmndTimeDst, &CmndAltitude, &CmndLedPower, &CmndLedState, &CmndLedMask, &CmndWifiPower, &CmndTempOffset,
|
||||||
#ifdef USE_I2C
|
#ifdef USE_I2C
|
||||||
&CmndI2cScan, CmndI2cDriver,
|
&CmndI2cScan, CmndI2cDriver,
|
||||||
#endif
|
|
||||||
#ifdef USE_CRASH
|
|
||||||
&CmndCrash,
|
|
||||||
#endif
|
#endif
|
||||||
&CmndSensor, &CmndDriver };
|
&CmndSensor, &CmndDriver };
|
||||||
|
|
||||||
|
@ -577,6 +571,9 @@ void CmndRestart(void)
|
||||||
restart_flag = 2;
|
restart_flag = 2;
|
||||||
ResponseCmndChar(D_JSON_RESTARTING);
|
ResponseCmndChar(D_JSON_RESTARTING);
|
||||||
break;
|
break;
|
||||||
|
case -1:
|
||||||
|
CmndCrash(); // force a crash
|
||||||
|
break;
|
||||||
case 99:
|
case 99:
|
||||||
AddLog_P(LOG_LEVEL_INFO, PSTR(D_LOG_APPLICATION D_RESTARTING));
|
AddLog_P(LOG_LEVEL_INFO, PSTR(D_LOG_APPLICATION D_RESTARTING));
|
||||||
EspRestart();
|
EspRestart();
|
||||||
|
|
|
@ -46,12 +46,8 @@ extern "C" void custom_crash_callback(struct rst_info * rst_info, uint32_t stack
|
||||||
// Generate a crash to test the crash recorder
|
// Generate a crash to test the crash recorder
|
||||||
void CmndCrash(void)
|
void CmndCrash(void)
|
||||||
{
|
{
|
||||||
if (1 == XdrvMailbox.payload) {
|
|
||||||
volatile uint32_t dummy;
|
volatile uint32_t dummy;
|
||||||
dummy = *((uint32_t*) 0x00000000); // invalid address
|
dummy = *((uint32_t*) 0x00000000);
|
||||||
} else {
|
|
||||||
ResponseCmndChar(D_JSON_ONE_TO_CRASH);
|
|
||||||
}
|
|
||||||
}
|
}
|
||||||
|
|
||||||
// Clear the RTC dump area when we do a normal reboot, this avoids garbage data to stay in RTC
|
// Clear the RTC dump area when we do a normal reboot, this avoids garbage data to stay in RTC
|
||||||
|
|
Loading…
Reference in New Issue