]> www.fi.muni.cz Git - bike-lights.git/blobdiff - firmware/control.c
Ability to quickly build testing firmware
[bike-lights.git] / firmware / control.c
index 0b842a74dc794f980d0dc2ced63792cb7e009cb0..eb35aca947ba3be71a0b2b53bb58d96e5e7ad7cd 100644 (file)
@@ -54,9 +54,9 @@ static pattern_t normal2_pattern[] = {
 };
 
 static pattern_t normal3_pattern[] = {
-       { 2, 0x1 },
+       { 3, 0x1 },
        { 0, 0x1 },
-       { 2, 0x1 },
+       { 3, 0x1 },
        { 0, 0x8 },
        { 1, 0x1 },
        { 0, 0x1 },
@@ -66,9 +66,9 @@ static pattern_t normal3_pattern[] = {
 };
 
 static pattern_t normal4_pattern[] = {
-       { 2, 0x1 },
+       { 4, 0x1 },
        { 0, 0x1 },
-       { 2, 0x1 },
+       { 4, 0x1 },
        { 0, 0x8 },
        { 1, 0x1 },
        { 0, 0x1 },
@@ -123,6 +123,10 @@ pattern_t *pwmled0_pattern_select()
 {
        // TODO: battery critical
 
+#ifndef TESTING_FW
+       return normal3_pattern;
+#endif
+
        if (towbar_mode)
                return NULL;
 
@@ -139,6 +143,9 @@ pattern_t *pwmled1_pattern_select()
 {
        // TODO: battery critical
 
+#ifndef TESTING_FW
+       return off_pattern;
+#endif
        if (towbar_mode) {
                switch (ambient_zone) {
                case 0:
@@ -163,6 +170,9 @@ pattern_t *pwmled2_pattern_select()
 {
        // TODO: battery critical
 
+#ifndef TESTING_FW
+       return on3_pattern;
+#endif
        switch (ambient_zone) {
        case 0: return dim_mode ? on2_pattern : on3_pattern;
        case 1: return dim_mode ? slow1_pattern : normal2_pattern;
@@ -179,7 +189,7 @@ pattern_t *status_led_pattern_select()
                return buttons_setup_status0_pattern_select();
 
        // FIXME: do something sane
-       return number_pattern(1 + ambient_zone, 1);
+       return number_pattern(1 + ambient_zone, 0);
 }
 
 pattern_t *illumination_led_pattern_select()