From: Jan "Yenya" Kasprzak Date: Sat, 15 Dec 2012 21:22:02 +0000 (+0100) Subject: buttons.c: longer keypress X-Git-Url: https://www.fi.muni.cz/~kas/git//home/kas/public_html/git/?p=bike-lights.git;a=commitdiff_plain;h=1658c813df2b638d6ce23d25723c2ad30f2440c9 buttons.c: longer keypress ... after we have increased the clock frequency --- diff --git a/firmware/buttons.c b/firmware/buttons.c index 1263fcb..2e80142 100644 --- a/firmware/buttons.c +++ b/firmware/buttons.c @@ -152,16 +152,16 @@ static void handle_button(unsigned char button, unsigned char cur, } else if (!cur && !prev) { // --- is still pressed --- uint16_t duration = jiffies - button_start[button]; - if (duration > 80) { + if (duration > 160) { set_status_led(button, on1_pattern); // acknowledge long press } } else if (cur && !prev) { // --- just released --- uint16_t duration = jiffies - button_start[button]; - if (duration > 6 && duration < 30) { + if (duration > 6 && duration < 60) { short_press(button); - } else if (duration > 80) { + } else if (duration > 160) { set_status_led(button, NULL); long_press(button); }