mirror of
https://github.com/arendst/Tasmota.git
synced 2025-07-25 19:56:30 +00:00
use "minimal" instead of "safeboot" (#21346)
This commit is contained in:
parent
599526a90c
commit
1e63c8924e
@ -407,14 +407,14 @@ void ButtonHandler(void) {
|
|||||||
|
|
||||||
}
|
}
|
||||||
#ifdef USE_ADC
|
#ifdef USE_ADC
|
||||||
#ifndef FIRMWARE_SAFEBOOT
|
#ifndef FIRMWARE_MINIMAL
|
||||||
else if (PinUsed(GPIO_ADC_BUTTON, button_index)) {
|
else if (PinUsed(GPIO_ADC_BUTTON, button_index)) {
|
||||||
button = AdcGetButton(Pin(GPIO_ADC_BUTTON, button_index));
|
button = AdcGetButton(Pin(GPIO_ADC_BUTTON, button_index));
|
||||||
}
|
}
|
||||||
else if (PinUsed(GPIO_ADC_BUTTON_INV, button_index)) {
|
else if (PinUsed(GPIO_ADC_BUTTON_INV, button_index)) {
|
||||||
button = AdcGetButton(Pin(GPIO_ADC_BUTTON_INV, button_index));
|
button = AdcGetButton(Pin(GPIO_ADC_BUTTON_INV, button_index));
|
||||||
}
|
}
|
||||||
#endif // FIRMWARE_SAFEBOOT
|
#endif // FIRMWARE_MINIMAL
|
||||||
#endif // USE_ADC
|
#endif // USE_ADC
|
||||||
|
|
||||||
XdrvMailbox.index = button_index;
|
XdrvMailbox.index = button_index;
|
||||||
|
@ -812,9 +812,9 @@ void CmndStatus(void)
|
|||||||
if (payload > MAX_STATUS) { return; } // {"Command":"Error"}
|
if (payload > MAX_STATUS) { return; } // {"Command":"Error"}
|
||||||
if (!Settings->flag.mqtt_enabled && (6 == payload)) { return; } // SetOption3 - Enable MQTT
|
if (!Settings->flag.mqtt_enabled && (6 == payload)) { return; } // SetOption3 - Enable MQTT
|
||||||
if (!TasmotaGlobal.energy_driver && (9 == payload)) { return; }
|
if (!TasmotaGlobal.energy_driver && (9 == payload)) { return; }
|
||||||
#ifndef FIRMWARE_SAFEBOOT
|
#ifndef FIRMWARE_MINIMAL
|
||||||
if (!CrashFlag() && (12 == payload)) { return; }
|
if (!CrashFlag() && (12 == payload)) { return; }
|
||||||
#endif // FIRMWARE_SAFEBOOT
|
#endif // FIRMWARE_MINIMAL
|
||||||
if (!Settings->flag3.shutter_mode && (13 == payload)) { return; }
|
if (!Settings->flag3.shutter_mode && (13 == payload)) { return; }
|
||||||
|
|
||||||
char stemp[200];
|
char stemp[200];
|
||||||
@ -1044,7 +1044,7 @@ void CmndStatus(void)
|
|||||||
CmndStatusResponse(11);
|
CmndStatusResponse(11);
|
||||||
}
|
}
|
||||||
|
|
||||||
#ifndef FIRMWARE_SAFEBOOT
|
#ifndef FIRMWARE_MINIMAL
|
||||||
if (CrashFlag()) {
|
if (CrashFlag()) {
|
||||||
if ((0 == payload) || (12 == payload)) {
|
if ((0 == payload) || (12 == payload)) {
|
||||||
Response_P(PSTR("{\"" D_CMND_STATUS D_STATUS12_STATUS "\":"));
|
Response_P(PSTR("{\"" D_CMND_STATUS D_STATUS12_STATUS "\":"));
|
||||||
@ -1053,7 +1053,7 @@ void CmndStatus(void)
|
|||||||
CmndStatusResponse(12);
|
CmndStatusResponse(12);
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
#endif // FIRMWARE_SAFEBOOT
|
#endif // FIRMWARE_MINIMAL
|
||||||
|
|
||||||
#ifdef USE_SHUTTER
|
#ifdef USE_SHUTTER
|
||||||
if ((0 == payload) || (13 == payload)) {
|
if ((0 == payload) || (13 == payload)) {
|
||||||
@ -1256,7 +1256,7 @@ void CmndRestart(void)
|
|||||||
TasmotaGlobal.restart_deepsleep = true;
|
TasmotaGlobal.restart_deepsleep = true;
|
||||||
ResponseCmndChar(PSTR("Go to sleep"));
|
ResponseCmndChar(PSTR("Go to sleep"));
|
||||||
break;
|
break;
|
||||||
#ifndef FIRMWARE_SAFEBOOT
|
#ifndef FIRMWARE_MINIMAL
|
||||||
case -1:
|
case -1:
|
||||||
CmndCrash(); // force a crash
|
CmndCrash(); // force a crash
|
||||||
break;
|
break;
|
||||||
@ -1266,7 +1266,7 @@ void CmndRestart(void)
|
|||||||
case -3:
|
case -3:
|
||||||
CmndBlockedLoop();
|
CmndBlockedLoop();
|
||||||
break;
|
break;
|
||||||
#endif // FIRMWARE_SAFEBOOT
|
#endif // FIRMWARE_MINIMAL
|
||||||
case 99:
|
case 99:
|
||||||
AddLog(LOG_LEVEL_INFO, PSTR(D_LOG_APPLICATION D_RESTARTING));
|
AddLog(LOG_LEVEL_INFO, PSTR(D_LOG_APPLICATION D_RESTARTING));
|
||||||
EspRestart();
|
EspRestart();
|
||||||
|
@ -17,7 +17,7 @@
|
|||||||
along with this program. If not, see <http://www.gnu.org/licenses/>.
|
along with this program. If not, see <http://www.gnu.org/licenses/>.
|
||||||
*/
|
*/
|
||||||
|
|
||||||
#ifndef FIRMWARE_SAFEBOOT
|
#ifndef FIRMWARE_MINIMAL
|
||||||
|
|
||||||
// Generate a crash to test the crash recorder
|
// Generate a crash to test the crash recorder
|
||||||
void CmndCrash(void)
|
void CmndCrash(void)
|
||||||
@ -364,4 +364,4 @@ void CrashDump(void)
|
|||||||
#endif
|
#endif
|
||||||
#endif
|
#endif
|
||||||
|
|
||||||
#endif // FIRMWARE_SAFEBOOT
|
#endif // FIRMWARE_MINIMAL
|
@ -1021,7 +1021,7 @@ bool MqttShowSensor(bool call_show_sensor) {
|
|||||||
|
|
||||||
GetSensorValues();
|
GetSensorValues();
|
||||||
|
|
||||||
#ifndef FIRMWARE_SAFEBOOT
|
#ifndef FIRMWARE_MINIMAL
|
||||||
if (TasmotaGlobal.global_update && Settings->flag.mqtt_add_global_info) { // SetOption2 (MQTT) Add global temperature/humidity/pressure info to JSON sensor message
|
if (TasmotaGlobal.global_update && Settings->flag.mqtt_add_global_info) { // SetOption2 (MQTT) Add global temperature/humidity/pressure info to JSON sensor message
|
||||||
if ((TasmotaGlobal.humidity > 0) || !isnan(TasmotaGlobal.temperature_celsius) || (TasmotaGlobal.pressure_hpa != 0)) {
|
if ((TasmotaGlobal.humidity > 0) || !isnan(TasmotaGlobal.temperature_celsius) || (TasmotaGlobal.pressure_hpa != 0)) {
|
||||||
uint32_t add_comma = 0;
|
uint32_t add_comma = 0;
|
||||||
@ -1056,7 +1056,7 @@ bool MqttShowSensor(bool call_show_sensor) {
|
|||||||
ResponseJsonEnd();
|
ResponseJsonEnd();
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
#endif // FIRMWARE_SAFEBOOT
|
#endif // FIRMWARE_MINIMAL
|
||||||
|
|
||||||
bool json_data_available = (ResponseLength() - json_data_start);
|
bool json_data_available = (ResponseLength() - json_data_start);
|
||||||
MqttAppendSensorUnits();
|
MqttAppendSensorUnits();
|
||||||
|
@ -1159,9 +1159,9 @@ void WifiDisable(void) {
|
|||||||
void EspRestart(void) {
|
void EspRestart(void) {
|
||||||
ResetPwm();
|
ResetPwm();
|
||||||
WifiShutdown(true);
|
WifiShutdown(true);
|
||||||
#ifndef FIRMWARE_SAFEBOOT
|
#ifndef FIRMWARE_MINIMAL
|
||||||
CrashDumpClear(); // Clear the stack dump in RTC
|
CrashDumpClear(); // Clear the stack dump in RTC
|
||||||
#endif // FIRMWARE_SAFEBOOT
|
#endif // FIRMWARE_MINIMAL
|
||||||
|
|
||||||
#ifdef CONFIG_IDF_TARGET_ESP32C3
|
#ifdef CONFIG_IDF_TARGET_ESP32C3
|
||||||
GpioForceHoldRelay(); // Retain the state when the chip or system is reset, for example, when watchdog time-out or Deep-sleep
|
GpioForceHoldRelay(); // Retain the state when the chip or system is reset, for example, when watchdog time-out or Deep-sleep
|
||||||
|
@ -249,11 +249,9 @@ const char HTTP_HEAD_STYLE3[] PROGMEM =
|
|||||||
"<body>"
|
"<body>"
|
||||||
"<div style='background:#%06x;text-align:left;display:inline-block;color:#%06x;min-width:340px;'>" // COLOR_BACKGROUND, COLOR_TEXT
|
"<div style='background:#%06x;text-align:left;display:inline-block;color:#%06x;min-width:340px;'>" // COLOR_BACKGROUND, COLOR_TEXT
|
||||||
#ifdef FIRMWARE_MINIMAL
|
#ifdef FIRMWARE_MINIMAL
|
||||||
#ifdef FIRMWARE_SAFEBOOT
|
|
||||||
"<span style='text-align:center;color:#%06x;'><h3>" D_SAFEBOOT "</h3></span>" // COLOR_TEXT_WARNING
|
"<span style='text-align:center;color:#%06x;'><h3>" D_SAFEBOOT "</h3></span>" // COLOR_TEXT_WARNING
|
||||||
#else
|
#else
|
||||||
"<div style='text-align:center;color:#%06x;'><h3>" D_MINIMAL_FIRMWARE_PLEASE_UPGRADE "</h3></div>" // COLOR_TEXT_WARNING
|
"<div style='text-align:center;color:#%06x;'><h3>" D_MINIMAL_FIRMWARE_PLEASE_UPGRADE "</h3></div>" // COLOR_TEXT_WARNING
|
||||||
#endif // FIRMWARE_SAFEBOOT
|
|
||||||
#endif // FIRMWARE_MINIMAL
|
#endif // FIRMWARE_MINIMAL
|
||||||
"<div style='text-align:center;color:#%06x;'><noscript>" D_NOSCRIPT "<br></noscript>" // COLOR_TITLE
|
"<div style='text-align:center;color:#%06x;'><noscript>" D_NOSCRIPT "<br></noscript>" // COLOR_TITLE
|
||||||
/*
|
/*
|
||||||
|
@ -1037,11 +1037,11 @@ void MqttConnected(void) {
|
|||||||
}
|
}
|
||||||
#endif // USE_WEBSERVER
|
#endif // USE_WEBSERVER
|
||||||
Response_P(PSTR("{\"Info3\":{\"" D_JSON_RESTARTREASON "\":"));
|
Response_P(PSTR("{\"Info3\":{\"" D_JSON_RESTARTREASON "\":"));
|
||||||
#ifndef FIRMWARE_SAFEBOOT
|
#ifndef FIRMWARE_MINIMAL
|
||||||
if (CrashFlag()) {
|
if (CrashFlag()) {
|
||||||
CrashDump();
|
CrashDump();
|
||||||
} else
|
} else
|
||||||
#endif // FIRMWARE_SAFEBOOT
|
#endif // FIRMWARE_MINIMAL
|
||||||
{
|
{
|
||||||
ResponseAppend_P(PSTR("\"%s\""), GetResetReason().c_str());
|
ResponseAppend_P(PSTR("\"%s\""), GetResetReason().c_str());
|
||||||
}
|
}
|
||||||
|
@ -17,7 +17,7 @@
|
|||||||
along with this program. If not, see <http://www.gnu.org/licenses/>.
|
along with this program. If not, see <http://www.gnu.org/licenses/>.
|
||||||
*/
|
*/
|
||||||
|
|
||||||
#ifndef FIRMWARE_SAFEBOOT
|
#ifndef FIRMWARE_MINIMAL
|
||||||
|
|
||||||
#ifdef USE_ADC
|
#ifdef USE_ADC
|
||||||
/*********************************************************************************************\
|
/*********************************************************************************************\
|
||||||
@ -934,4 +934,4 @@ bool Xsns02(uint32_t function) {
|
|||||||
}
|
}
|
||||||
|
|
||||||
#endif // USE_ADC
|
#endif // USE_ADC
|
||||||
#endif // FIRMWARE_SAFEBOOT
|
#endif // FIRMWARE_MINIMAL
|
Loading…
x
Reference in New Issue
Block a user