From 4fe7d9cb81e1fa2baf5134ed3770e5fb70c6a61a Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Patrick=20Ha=C3=9Fel?= Date: Thu, 7 Aug 2025 20:48:03 +0200 Subject: [PATCH] some fixes after first hardware-test --- src/Button.h | 3 +-- src/main.cpp | 4 +++- 2 files changed, 4 insertions(+), 3 deletions(-) diff --git a/src/Button.h b/src/Button.h index a1b28b1..dbde8b0 100644 --- a/src/Button.h +++ b/src/Button.h @@ -59,8 +59,7 @@ public: } lastState = currentState; lastMillis = currentMillis; - } - if (lastState && duration >= 3000 && !pressedLong) { + } else if (lastState && duration >= 3000 && !pressedLong) { pressedLong = true; callback(BUTTON_PRESSED_LONG); } diff --git a/src/main.cpp b/src/main.cpp index a71aa3c..c9394c4 100644 --- a/src/main.cpp +++ b/src/main.cpp @@ -22,6 +22,7 @@ void setup() { Serial.println("\n\n\nStartup!"); beepSetup(); + button.setup(); display.setup(); mode.init(); serverSetup(); @@ -31,6 +32,7 @@ void loop() { stepMode(); readConsole(); wifiLoop(); + button.loop(); } void stepMode() { @@ -56,7 +58,7 @@ void buttonCallback(const ButtonEvent event) { if (event == BUTTON_PRESSED) { mode.buttonOK(); } - if (BUTTON_PRESSED_LONG) { + if (event == BUTTON_PRESSED_LONG) { mode.buttonESC(); } }