From: Jan "Yenya" Kasprzak Date: Fri, 19 Jul 2013 16:28:20 +0000 (+0200) Subject: buttons.c: faster brake sensor reaction time X-Git-Url: https://www.fi.muni.cz/~kas/git//home/kas/public_html/git/?p=bike-lights.git;a=commitdiff_plain;h=b2a7818a12aab1915c19ae65af12b2f16c2f4da6 buttons.c: faster brake sensor reaction time If the ADC reads as "brake on" for two jiffies (1/8 of second), consider it being on. Previously the interval was too long (1/4 s). --- diff --git a/firmware/buttons.c b/firmware/buttons.c index c3cdc52..4f7a5ce 100644 --- a/firmware/buttons.c +++ b/firmware/buttons.c @@ -235,7 +235,7 @@ static void handle_brake(unsigned char cur, unsigned char prev) // --- no change --- duration = jiffies - button_start[2]; - if (duration <= 3) + if (duration == 0) // at least two jiffies return; if (cur) {