From: Jan "Yenya" Kasprzak Date: Wed, 21 Nov 2012 22:12:31 +0000 (+0100) Subject: buttons.c: fix for setup timeout X-Git-Url: https://www.fi.muni.cz/~kas/git//home/kas/public_html/git/?p=bike-lights.git;a=commitdiff_plain;h=014b5cfa49f3697ad13d717949327e4b790e20f9 buttons.c: fix for setup timeout we need to test whether the timeout is reached only when the setup is in progress ;-) --- diff --git a/firmware/buttons.c b/firmware/buttons.c index bcbec01..90f5701 100644 --- a/firmware/buttons.c +++ b/firmware/buttons.c @@ -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));