mirror of
https://github.com/arendst/Tasmota.git
synced 2025-07-25 11:46:31 +00:00
Add ESP32 Command `Restart 3
` to switch between SafeBoot and Production
This commit is contained in:
parent
b26e74960e
commit
91f42fc8b8
@ -5,7 +5,7 @@ All notable changes to this project will be documented in this file.
|
|||||||
|
|
||||||
## [11.1.0.2]
|
## [11.1.0.2]
|
||||||
### Added
|
### Added
|
||||||
|
- ESP32 Command ``Restart 3`` to switch between SafeBoot and Production
|
||||||
|
|
||||||
### Changed
|
### Changed
|
||||||
- ESP32 Tasmota SafeBoot with changed partition scheme allowing larger binaries
|
- ESP32 Tasmota SafeBoot with changed partition scheme allowing larger binaries
|
||||||
|
@ -114,6 +114,7 @@ The latter links can be used for OTA upgrades too like ``OtaUrl http://ota.tasmo
|
|||||||
- Support for daisy chaining MAX7219 displays [#15345](https://github.com/arendst/Tasmota/issues/15345)
|
- Support for daisy chaining MAX7219 displays [#15345](https://github.com/arendst/Tasmota/issues/15345)
|
||||||
- Sonoff SPM delayed SetPowerOnState [#13447](https://github.com/arendst/Tasmota/issues/13447)
|
- Sonoff SPM delayed SetPowerOnState [#13447](https://github.com/arendst/Tasmota/issues/13447)
|
||||||
- Support for flowrate meters like YF-DN50 and similary [#15474](https://github.com/arendst/Tasmota/issues/15474)
|
- Support for flowrate meters like YF-DN50 and similary [#15474](https://github.com/arendst/Tasmota/issues/15474)
|
||||||
|
- ESP32 Command ``Restart 3`` to switch between SafeBoot and Production
|
||||||
|
|
||||||
### Breaking Changed
|
### Breaking Changed
|
||||||
|
|
||||||
|
@ -875,6 +875,14 @@ void CmndRestart(void)
|
|||||||
TasmotaGlobal.restart_halt = true;
|
TasmotaGlobal.restart_halt = true;
|
||||||
ResponseCmndChar(PSTR(D_JSON_HALTING));
|
ResponseCmndChar(PSTR(D_JSON_HALTING));
|
||||||
break;
|
break;
|
||||||
|
#ifdef ESP32
|
||||||
|
case 3:
|
||||||
|
if (EspPrepSwitchToOtherPartition()) {
|
||||||
|
TasmotaGlobal.restart_flag = 2;
|
||||||
|
ResponseCmndChar(PSTR("Switching"));
|
||||||
|
}
|
||||||
|
break;
|
||||||
|
#endif // ESP32
|
||||||
case -1:
|
case -1:
|
||||||
CmndCrash(); // force a crash
|
CmndCrash(); // force a crash
|
||||||
break;
|
break;
|
||||||
|
@ -312,6 +312,20 @@ void EspPrepRestartToSafeBoot(void) {
|
|||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
|
bool EspPrepSwitchToOtherPartition(void) {
|
||||||
|
bool valid = EspSingleOtaPartition();
|
||||||
|
if (valid) {
|
||||||
|
bool running_factory = EspRunningFactoryPartition();
|
||||||
|
if (!running_factory) {
|
||||||
|
EspPrepRestartToSafeBoot();
|
||||||
|
} else {
|
||||||
|
const esp_partition_t* partition = esp_ota_get_next_update_partition(nullptr);
|
||||||
|
esp_ota_set_boot_partition(partition);
|
||||||
|
}
|
||||||
|
}
|
||||||
|
return valid;
|
||||||
|
}
|
||||||
|
|
||||||
uint32_t EspFlashBaseAddress(void) {
|
uint32_t EspFlashBaseAddress(void) {
|
||||||
if (EspSingleOtaPartition()) { // Only one partition so start at end of sketch
|
if (EspSingleOtaPartition()) { // Only one partition so start at end of sketch
|
||||||
const esp_partition_t *running = esp_ota_get_running_partition();
|
const esp_partition_t *running = esp_ota_get_running_partition();
|
||||||
|
Loading…
x
Reference in New Issue
Block a user