mirror of
https://github.com/arendst/Tasmota.git
synced 2025-07-27 20:56:35 +00:00
Change QPC detection from 4 to 7 power interrupts
Change Quick Power Cycle detection from 4 to 7 power interrupts (#4066)
This commit is contained in:
parent
a9cd30f26e
commit
c11952595e
@ -54,4 +54,7 @@ The following binary downloads have been compiled with ESP8266/Arduino library c
|
|||||||
|
|
||||||
### Version 8.3.0.1
|
### Version 8.3.0.1
|
||||||
|
|
||||||
|
- Change KNX pow function to approximative pow saving 5k of code space
|
||||||
|
- Change Mutichannel Gas sensor pow function to approximative pow saving 5k of code space
|
||||||
|
- Change Quick Power Cycle detection from 4 to 7 power interrupts (#4066)
|
||||||
- Fix default state of ``SetOption73 0`` for button decoupling and send multi-press and hold MQTT messages
|
- Fix default state of ``SetOption73 0`` for button decoupling and send multi-press and hold MQTT messages
|
||||||
|
@ -2,6 +2,9 @@
|
|||||||
|
|
||||||
### 8.3.0.1 20200514
|
### 8.3.0.1 20200514
|
||||||
|
|
||||||
|
- Change KNX pow function to approximative pow saving 5k of code space
|
||||||
|
- Change Mutichannel Gas sensor pow function to approximative pow saving 5k of code space
|
||||||
|
- Change Quick Power Cycle detection from 4 to 7 power interrupts (#4066)
|
||||||
- Fix default state of ``SetOption73 0`` for button decoupling and send multi-press and hold MQTT messages
|
- Fix default state of ``SetOption73 0`` for button decoupling and send multi-press and hold MQTT messages
|
||||||
|
|
||||||
## Released
|
## Released
|
||||||
|
@ -357,9 +357,9 @@ void UpdateQuickPowerCycle(bool update)
|
|||||||
#else // ESP32
|
#else // ESP32
|
||||||
QPCRead(&pc_register, sizeof(pc_register));
|
QPCRead(&pc_register, sizeof(pc_register));
|
||||||
#endif // ESP8266 - ESP32
|
#endif // ESP8266 - ESP32
|
||||||
if (update && ((pc_register & 0xFFFFFFF0) == 0xFFA55AB0)) {
|
if (update && ((pc_register & 0xFFFFFF80) == 0xFFA55A80)) {
|
||||||
uint32_t counter = ((pc_register & 0xF) << 1) & 0xF;
|
uint32_t counter = ((pc_register & 0x7F) << 1) & 0x7F;
|
||||||
if (0 == counter) { // 4 power cycles in a row
|
if (0 == counter) { // 7 power cycles in a row
|
||||||
SettingsErase(3); // Quickly reset all settings including QuickPowerCycle flag
|
SettingsErase(3); // Quickly reset all settings including QuickPowerCycle flag
|
||||||
EspRestart(); // And restart
|
EspRestart(); // And restart
|
||||||
} else {
|
} else {
|
||||||
@ -372,8 +372,8 @@ void UpdateQuickPowerCycle(bool update)
|
|||||||
AddLog_P2(LOG_LEVEL_DEBUG, PSTR("QPC: Flag %02X"), counter);
|
AddLog_P2(LOG_LEVEL_DEBUG, PSTR("QPC: Flag %02X"), counter);
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
else if (pc_register != 0xFFA55ABF) {
|
else if (pc_register != 0xFFA55AFF) {
|
||||||
pc_register = 0xFFA55ABF;
|
pc_register = 0xFFA55AFF;
|
||||||
#ifdef ESP8266
|
#ifdef ESP8266
|
||||||
// Assume flash is default all ones and setting a bit to zero does not need an erase
|
// Assume flash is default all ones and setting a bit to zero does not need an erase
|
||||||
if (ESP.flashEraseSector(pc_location)) {
|
if (ESP.flashEraseSector(pc_location)) {
|
||||||
|
Loading…
x
Reference in New Issue
Block a user