From 9e8fb0d31b22021b0f909056672bfa9ec037199d Mon Sep 17 00:00:00 2001 From: Martin Mares Date: Wed, 6 May 2020 22:41:35 +0200 Subject: [PATCH] Lights: Better handling of long-press-to-max --- ursaryd.c | 6 +++--- 1 file changed, 3 insertions(+), 3 deletions(-) diff --git a/ursaryd.c b/ursaryd.c index 4441496..f9ce3b9 100644 --- a/ursaryd.c +++ b/ursaryd.c @@ -562,13 +562,13 @@ static void update_lights_from_button(int ch, int on) }}; if (on) + timer_add_rel(&lights_button_timer[ch], 500); + else if (timer_is_active(&lights_button_timer[ch])) { + timer_del(&lights_button_timer[ch]); lights_on[ch] = !lights_on[ch]; update_lights(); - timer_add_rel(&lights_button_timer[ch], 1000); } - else - timer_del(&lights_button_timer[ch]); } /*** Main update routines ***/ -- 2.39.2