From 455118882b91666553f9702e33aa64bb3c5e930d Mon Sep 17 00:00:00 2001 From: Thomas Kolb Date: Sun, 19 May 2024 20:35:14 +0200 Subject: [PATCH] Prevent to rapid time increment after turn-on --- src/main.c | 1 + 1 file changed, 1 insertion(+) diff --git a/src/main.c b/src/main.c index ca00744..259e6b7 100644 --- a/src/main.c +++ b/src/main.c @@ -216,6 +216,7 @@ static void update_countdown_fsm(uint32_t time_ms) // extend time when on button is pressed again if(buttons_get_events(BTN_ON) & BTN_EVENT_PRESSED || (buttons_is_pressed(BTN_ON) + && (time_in_state > 3000) && ((time_ms - buttons_get_last_change_time(BTN_ON)) > 500) && ((time_ms - buttons_get_last_change_time(BTN_ON)) % 500 == 0))) { if(m_countdown_off_time < 10 * ONE_MINUTE) {