mirror of https://github.com/arendst/Tasmota.git
Prevent crash on start with >100Hz on counter input
Same procedure. setoption65 1 is a working workaround to avoid a crash on starting the device when there is a frequency of 100Hz or higher on one counter. The change temporarily disables the counter during the access to the flash. I', currently not sure if this is an ESP8266 only problem or also an ESP32 problem that the interrupt of the counter and flash access could cause a crash.
This commit is contained in:
parent
aea2315664
commit
8729b385f0
|
@ -230,7 +230,9 @@ void UpdateQuickPowerCycle(bool update) {
|
|||
|
||||
const uint32_t QPC_COUNT = 7; // Number of Power Cycles before Settings erase
|
||||
const uint32_t QPC_SIGNATURE = 0xFFA55AFF;
|
||||
|
||||
#ifdef USE_COUNTER
|
||||
CounterInterruptDisable(true);
|
||||
#endif
|
||||
#ifdef ESP8266
|
||||
const uint32_t qpc_sector = SETTINGS_LOCATION - CFG_ROTATES;
|
||||
const uint32_t qpc_location = qpc_sector * SPI_FLASH_SEC_SIZE;
|
||||
|
@ -280,10 +282,11 @@ void UpdateQuickPowerCycle(bool update) {
|
|||
AddLog(LOG_LEVEL_INFO, PSTR("QPC: Reset"));
|
||||
}
|
||||
#endif // ESP32
|
||||
|
||||
#ifdef USE_COUNTER
|
||||
CounterInterruptDisable(false);
|
||||
#endif
|
||||
#endif // FIRMWARE_MINIMAL
|
||||
}
|
||||
|
||||
#ifdef USE_EMERGENCY_RESET
|
||||
/*********************************************************************************************\
|
||||
* Emergency reset if Rx and Tx are tied together
|
||||
|
|
Loading…
Reference in New Issue