From 029df4ff3de7b54c13de8dcf817f52384c509319 Mon Sep 17 00:00:00 2001 From: "J. Nick Koston" Date: Mon, 22 Dec 2025 10:48:10 -1000 Subject: [PATCH] [safe_mode] Remove unnecessary blocking sync from successful boot reset --- esphome/components/safe_mode/safe_mode.cpp | 6 ++++-- 1 file changed, 4 insertions(+), 2 deletions(-) diff --git a/esphome/components/safe_mode/safe_mode.cpp b/esphome/components/safe_mode/safe_mode.cpp index 7dbbda12c98..c9332222734 100644 --- a/esphome/components/safe_mode/safe_mode.cpp +++ b/esphome/components/safe_mode/safe_mode.cpp @@ -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); }