mirror of
https://github.com/esphome/esphome.git
synced 2026-09-16 01:28:39 +00:00
[safe_mode] Remove unnecessary blocking sync from successful boot reset
This commit is contained in:
@@ -142,8 +142,10 @@ uint32_t SafeModeComponent::read_rtc_() {
|
||||
}
|
||||
|
||||
void SafeModeComponent::clean_rtc() {
|
||||
// Save without sync - preferences will be written at shutdown or by IntervalSyncer
|
||||
// This avoids blocking the loop for 50+ ms on flash write
|
||||
// Save without sync - preferences will be written at shutdown or by IntervalSyncer.
|
||||
// This avoids blocking the loop for 50+ ms on flash write. If the device crashes
|
||||
// before sync, the boot wasn't really successful anyway and the counter should
|
||||
// remain incremented.
|
||||
uint32_t val = 0;
|
||||
this->rtc_.save(&val);
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user