]> www.fi.muni.cz Git - bike-lights.git/commitdiff
buttons.c: fix for setup timeout
authorJan "Yenya" Kasprzak <kas@fi.muni.cz>
Wed, 21 Nov 2012 22:12:31 +0000 (23:12 +0100)
committerJan "Yenya" Kasprzak <kas@fi.muni.cz>
Wed, 21 Nov 2012 22:12:31 +0000 (23:12 +0100)
we need to test whether the timeout is reached only when the setup
is in progress ;-)

firmware/buttons.c

index bcbec0112cc67df1c8e5614f18144f0a02cc222a..90f57012bced79ac90605687bccafab15d9bfcdc 100644 (file)
@@ -159,7 +159,7 @@ void timer_check_buttons()
 
        prev_pin = pin;
 
-       if (jiffies - user_params_starttime > 500) {
+       if (user_params_state && jiffies - user_params_starttime > 500) {
                user_params_state = 0;
                set_status_led(0, status_pattern_select(0));
                set_status_led(1, status_pattern_select(1));