From 7b32a875965e4701332c6f406e1bb51294f267f0 Mon Sep 17 00:00:00 2001 From: Jonas Diemer Date: Mon, 29 Dec 2025 13:18:12 +0100 Subject: [PATCH] Recalibrated power button duration, decreased long setting slightly. (#149) Slight tuning, as I noticed sometimes inconsistent behavior (reported >200ms of calibration value, I assume related to the Serial output). --- src/CrossPointSettings.h | 2 +- src/main.cpp | 7 ++++--- 2 files changed, 5 insertions(+), 4 deletions(-) diff --git a/src/CrossPointSettings.h b/src/CrossPointSettings.h index 5ad879b..c096cdb 100644 --- a/src/CrossPointSettings.h +++ b/src/CrossPointSettings.h @@ -59,7 +59,7 @@ class CrossPointSettings { // Get singleton instance static CrossPointSettings& getInstance() { return instance; } - uint16_t getPowerButtonDuration() const { return shortPwrBtn ? 10 : 500; } + uint16_t getPowerButtonDuration() const { return shortPwrBtn ? 10 : 400; } bool saveToFile() const; bool loadFromFile(); diff --git a/src/main.cpp b/src/main.cpp index 877d1c6..b617ef8 100644 --- a/src/main.cpp +++ b/src/main.cpp @@ -85,7 +85,7 @@ void verifyWakeupLongPress() { const auto start = millis(); bool abort = false; // It takes us some time to wake up from deep sleep, so we need to subtract that from the duration - uint16_t calibration = 25; + uint16_t calibration = 29; uint16_t calibratedPressDuration = (calibration < SETTINGS.getPowerButtonDuration()) ? SETTINGS.getPowerButtonDuration() - calibration : 1; @@ -180,8 +180,6 @@ void setup() { Serial.begin(115200); } - Serial.printf("[%lu] [ ] Starting CrossPoint version " CROSSPOINT_VERSION "\n", millis()); - inputManager.begin(); // Initialize pins pinMode(BAT_GPIO0, INPUT); @@ -204,6 +202,9 @@ void setup() { // verify power button press duration after we've read settings. verifyWakeupLongPress(); + // First serial output only here to avoid timing inconsistencies for power button press duration verification + Serial.printf("[%lu] [ ] Starting CrossPoint version " CROSSPOINT_VERSION "\n", millis()); + setupDisplayAndFonts(); exitActivity();