]> www.fi.muni.cz Git - bike-lights.git/commitdiff
pattern.c: another attempt at brake handling
authorJan "Yenya" Kasprzak <kas@fi.muni.cz>
Wed, 26 Jun 2013 22:19:52 +0000 (00:19 +0200)
committerJan "Yenya" Kasprzak <kas@fi.muni.cz>
Wed, 26 Jun 2013 22:19:52 +0000 (00:19 +0200)
- set read pwmled (0) to mode 2 when braking unconditionally

firmware/pattern.c

index e7a8a09314c8a9a57c8c3a29c726c5893afddd01..83a932e2e0abc21b5fb075920b985bfeff7bf4f8 100644 (file)
@@ -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);