From df2e49c3e9c369cf7447c19e8564bed59d715201 Mon Sep 17 00:00:00 2001 From: Lloyd Date: Wed, 6 Aug 2025 22:01:33 +0100 Subject: [PATCH] Fix: Reset ESP32 RTC clock on software reset Updated `ESP32RTCClock::begin()` to treat software reset (`ESP_RST_SW`) the same as power-on reset (`ESP_RST_POWERON`), ensuring the RTC clock resets to the default time when triggered via CLI reboot command. --- src/helpers/ESP32Board.h | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/src/helpers/ESP32Board.h b/src/helpers/ESP32Board.h index e566f929..47069191 100644 --- a/src/helpers/ESP32Board.h +++ b/src/helpers/ESP32Board.h @@ -94,7 +94,7 @@ class ESP32RTCClock : public mesh::RTCClock { ESP32RTCClock() { } void begin() { esp_reset_reason_t reason = esp_reset_reason(); - if (reason == ESP_RST_POWERON) { + if (reason == ESP_RST_POWERON || reason == ESP_RST_SW) { // start with some date/time in the recent past struct timeval tv; tv.tv_sec = 1715770351; // 15 May 2024, 8:50pm