Prevent to rapid time increment after turn-on

This commit is contained in:
Thomas Kolb 2024-05-19 20:35:14 +02:00
parent deca973854
commit 455118882b

View file

@ -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) {