From: Jan "Yenya" Kasprzak Date: Wed, 26 Jun 2013 22:19:52 +0000 (+0200) Subject: pattern.c: another attempt at brake handling X-Git-Url: https://www.fi.muni.cz/~kas/git//home/kas/public_html/git/?a=commitdiff_plain;h=db53b0a0ea858252c71069c58b72932abc9fc40f;p=bike-lights.git pattern.c: another attempt at brake handling - set read pwmled (0) to mode 2 when braking unconditionally --- diff --git a/firmware/pattern.c b/firmware/pattern.c index e7a8a09..83a932e 100644 --- a/firmware/pattern.c +++ b/firmware/pattern.c @@ -111,13 +111,9 @@ void pwmleds_update_mode() mode2 = (mode >> 3) & 3; if (braking && !battery_critical) { - if (mode0) { - mode0 = 2; - if (mode2 == 2) - mode2 = 3; - } else { - mode0 = 1; - } + mode0 = 2; + if (mode2 == 2) + mode2 = 3; } pwmled_set_mode(0, mode0);