mirror of
https://github.com/arendst/Tasmota.git
synced 2025-07-30 14:16:32 +00:00
Delay initial flash write
* Stop enforcing flashmode dout but it is still mandatory * Moved bootcount update (being first) flash write to 10 seconds after restart
This commit is contained in:
parent
a1ff029335
commit
9eacabc4f0
@ -1,5 +1,6 @@
|
|||||||
/* 6.3.0.8 20181115
|
/* 6.3.0.8 20181115
|
||||||
* Stop enforcing flashmode dout. Still mandatory but this a chk for possible future flash corruption
|
* Stop enforcing flashmode dout but it is still mandatory
|
||||||
|
* Moved bootcount update (being first) flash write to 10 seconds after restart
|
||||||
*
|
*
|
||||||
* 6.3.0.7 20181111
|
* 6.3.0.7 20181111
|
||||||
* Fix wifi connection errors using wifi disconnect and ESP.reset instead of ESP.restart
|
* Fix wifi connection errors using wifi disconnect and ESP.reset instead of ESP.restart
|
||||||
|
@ -334,6 +334,7 @@ void SettingsErase(uint8_t type)
|
|||||||
1 = Erase SDK parameter area at end of linker memory model (0x0FDxxx - 0x0FFFFF) solving possible wifi errors
|
1 = Erase SDK parameter area at end of linker memory model (0x0FDxxx - 0x0FFFFF) solving possible wifi errors
|
||||||
*/
|
*/
|
||||||
|
|
||||||
|
#ifndef BE_MINIMAL
|
||||||
bool result;
|
bool result;
|
||||||
|
|
||||||
uint32_t _sectorStart = (ESP.getSketchSize() / SPI_FLASH_SEC_SIZE) + 1;
|
uint32_t _sectorStart = (ESP.getSketchSize() / SPI_FLASH_SEC_SIZE) + 1;
|
||||||
@ -362,6 +363,7 @@ void SettingsErase(uint8_t type)
|
|||||||
}
|
}
|
||||||
OsWatchLoop();
|
OsWatchLoop();
|
||||||
}
|
}
|
||||||
|
#endif // BE_MINIMAL
|
||||||
}
|
}
|
||||||
|
|
||||||
// Copied from 2.4.0 as 2.3.0 is incomplete
|
// Copied from 2.4.0 as 2.3.0 is incomplete
|
||||||
|
@ -1652,6 +1652,10 @@ void PerformEverySecond(void)
|
|||||||
if (BOOT_LOOP_TIME == uptime) {
|
if (BOOT_LOOP_TIME == uptime) {
|
||||||
RtcReboot.fast_reboot_count = 0;
|
RtcReboot.fast_reboot_count = 0;
|
||||||
RtcRebootSave();
|
RtcRebootSave();
|
||||||
|
|
||||||
|
Settings.bootcount++; // Moved to here to stop flash writes during start-up
|
||||||
|
snprintf_P(log_data, sizeof(log_data), PSTR(D_LOG_APPLICATION D_BOOT_COUNT " %d"), Settings.bootcount);
|
||||||
|
AddLog(LOG_LEVEL_DEBUG);
|
||||||
}
|
}
|
||||||
|
|
||||||
if ((4 == uptime) && (SONOFF_IFAN02 == Settings.module)) { // Microcontroller needs 3 seconds before accepting commands
|
if ((4 == uptime) && (SONOFF_IFAN02 == Settings.module)) { // Microcontroller needs 3 seconds before accepting commands
|
||||||
@ -2635,13 +2639,13 @@ void setup(void)
|
|||||||
mdns_delayed_start = Settings.param[P_MDNS_DELAYED_START];
|
mdns_delayed_start = Settings.param[P_MDNS_DELAYED_START];
|
||||||
seriallog_level = Settings.seriallog_level;
|
seriallog_level = Settings.seriallog_level;
|
||||||
seriallog_timer = SERIALLOG_TIMER;
|
seriallog_timer = SERIALLOG_TIMER;
|
||||||
#ifndef USE_EMULATION
|
|
||||||
Settings.flag2.emulation = 0;
|
|
||||||
#endif // USE_EMULATION
|
|
||||||
syslog_level = Settings.syslog_level;
|
syslog_level = Settings.syslog_level;
|
||||||
stop_flash_rotate = Settings.flag.stop_flash_rotate;
|
stop_flash_rotate = Settings.flag.stop_flash_rotate;
|
||||||
save_data_counter = Settings.save_data;
|
save_data_counter = Settings.save_data;
|
||||||
sleep = Settings.sleep;
|
sleep = Settings.sleep;
|
||||||
|
#ifndef USE_EMULATION
|
||||||
|
Settings.flag2.emulation = 0;
|
||||||
|
#endif // USE_EMULATION
|
||||||
|
|
||||||
// Disable functionality as possible cause of fast restart within BOOT_LOOP_TIME seconds (Exception, WDT or restarts)
|
// Disable functionality as possible cause of fast restart within BOOT_LOOP_TIME seconds (Exception, WDT or restarts)
|
||||||
if (RtcReboot.fast_reboot_count > 1) { // Restart twice
|
if (RtcReboot.fast_reboot_count > 1) { // Restart twice
|
||||||
@ -2667,10 +2671,6 @@ void setup(void)
|
|||||||
AddLog(LOG_LEVEL_DEBUG);
|
AddLog(LOG_LEVEL_DEBUG);
|
||||||
}
|
}
|
||||||
|
|
||||||
Settings.bootcount++;
|
|
||||||
snprintf_P(log_data, sizeof(log_data), PSTR(D_LOG_APPLICATION D_BOOT_COUNT " %d"), Settings.bootcount);
|
|
||||||
AddLog(LOG_LEVEL_DEBUG);
|
|
||||||
|
|
||||||
Format(mqtt_client, Settings.mqtt_client, sizeof(mqtt_client));
|
Format(mqtt_client, Settings.mqtt_client, sizeof(mqtt_client));
|
||||||
Format(mqtt_topic, Settings.mqtt_topic, sizeof(mqtt_topic));
|
Format(mqtt_topic, Settings.mqtt_topic, sizeof(mqtt_topic));
|
||||||
if (strstr(Settings.hostname, "%")) {
|
if (strstr(Settings.hostname, "%")) {
|
||||||
|
Loading…
x
Reference in New Issue
Block a user