]> www.fi.muni.cz Git - bike-lights.git/commitdiff
buttons.c: longer keypress
authorJan "Yenya" Kasprzak <kas@fi.muni.cz>
Sat, 15 Dec 2012 21:22:02 +0000 (22:22 +0100)
committerJan "Yenya" Kasprzak <kas@fi.muni.cz>
Sat, 15 Dec 2012 21:22:02 +0000 (22:22 +0100)
... after we have increased the clock frequency

firmware/buttons.c

index 1263fcb487adc37affa6eca9c1edbac56edc2090..2e80142b3be896c0bbf2ffa9961c1b2c48127a58 100644 (file)
@@ -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);
                }