Change from `Crash` to `Restart -1`

This commit is contained in:
Hadinger 2019-12-07 11:00:32 +01:00
parent 5a0febc64e
commit 7796714ba0
4 changed files with 5 additions and 17 deletions

View File

@ -293,8 +293,6 @@
#define D_JSON_FLAG "FLAG"
#define D_JSON_BASE "BASE"
#define D_CMND_TEMPOFFSET "TempOffset"
#define D_CMND_CRASH "Crash"
#define D_JSON_ONE_TO_CRASH "1 to crash"
// Commands xdrv_01_mqtt.ino
#define D_CMND_MQTTLOG "MqttLog"

View File

@ -268,9 +268,6 @@
//#define MY_LANGUAGE zh-CN // Chinese (Simplified) in China
//#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 ---------------------------
#define WIFI_SOFT_AP_CHANNEL 1 // Soft Access Point Channel number between 1 and 13 as used by Wifi Manager web GUI

View File

@ -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 "|"
#ifdef USE_I2C
D_CMND_I2CSCAN "|" D_CMND_I2CDRIVER "|"
#endif
#ifdef USE_CRASH
D_CMND_CRASH "|"
#endif
D_CMND_SENSOR "|" D_CMND_DRIVER ;
@ -47,9 +44,6 @@ void (* const TasmotaCommand[])(void) PROGMEM = {
&CmndTimeDst, &CmndAltitude, &CmndLedPower, &CmndLedState, &CmndLedMask, &CmndWifiPower, &CmndTempOffset,
#ifdef USE_I2C
&CmndI2cScan, CmndI2cDriver,
#endif
#ifdef USE_CRASH
&CmndCrash,
#endif
&CmndSensor, &CmndDriver };
@ -577,6 +571,9 @@ void CmndRestart(void)
restart_flag = 2;
ResponseCmndChar(D_JSON_RESTARTING);
break;
case -1:
CmndCrash(); // force a crash
break;
case 99:
AddLog_P(LOG_LEVEL_INFO, PSTR(D_LOG_APPLICATION D_RESTARTING));
EspRestart();

View File

@ -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
void CmndCrash(void)
{
if (1 == XdrvMailbox.payload) {
volatile uint32_t dummy;
dummy = *((uint32_t*) 0x00000000); // invalid address
} else {
ResponseCmndChar(D_JSON_ONE_TO_CRASH);
}
dummy = *((uint32_t*) 0x00000000);
}
// Clear the RTC dump area when we do a normal reboot, this avoids garbage data to stay in RTC