From: Martin Mares Date: Wed, 6 May 2020 20:41:35 +0000 (+0200) Subject: Lights: Better handling of long-press-to-max X-Git-Url: http://mj.ucw.cz/gitweb/?a=commitdiff_plain;h=9e8fb0d31b22021b0f909056672bfa9ec037199d;p=ursary.git Lights: Better handling of long-press-to-max --- 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 ***/