From f30b47ec6905e7708bdce7e0c3f3acbad2f838f0 Mon Sep 17 00:00:00 2001 From: Stanislav Khromov Date: Thu, 15 Jan 2026 00:25:48 +0100 Subject: [PATCH] Update main.cpp --- src/main.cpp | 8 ++++++++ 1 file changed, 8 insertions(+) diff --git a/src/main.cpp b/src/main.cpp index 8a7c3b91..fdb5d317 100644 --- a/src/main.cpp +++ b/src/main.cpp @@ -6,6 +6,7 @@ #include #include #include +#include #include @@ -150,6 +151,13 @@ void enterNewActivity(Activity* activity) { // Verify long press on wake-up from deep sleep void verifyWakeupLongPress() { + // Only verify button press if waking from deep sleep + // Skip for software resets (esp_restart) and power-on + esp_reset_reason_t reason = esp_reset_reason(); + if (reason != ESP_RST_DEEPSLEEP) { + return; + } + // Give the user up to 1000ms to start holding the power button, and must hold for SETTINGS.getPowerButtonDuration() const auto start = millis(); bool abort = false;