]> www.fi.muni.cz Git - bike-lights.git/commitdiff
control.c: test pattern for debugging pwmleds
authorJan "Yenya" Kasprzak <kas@fi.muni.cz>
Wed, 26 Jun 2013 21:48:54 +0000 (23:48 +0200)
committerJan "Yenya" Kasprzak <kas@fi.muni.cz>
Wed, 26 Jun 2013 21:48:54 +0000 (23:48 +0200)
firmware/control.c

index 8477722f86bd8095d461af75735c90e991b6c4c1..9b356993d359f575bdc76b865fd7e6fddbe91fff 100644 (file)
@@ -64,6 +64,17 @@ pattern_t on_pattern[] = {
        PATTERN_END
 };
 
+// #define TEST_PATTERN 1
+#ifdef TEST_PATTERN
+pattern_t test_pattern[] = {
+       { PWM_PAT(1, 0, 0), D_13 },
+       { PWM_PAT(2, 0, 0), D_13 },
+       { PWM_PAT(0, 0, 1), D_13 },
+       { PWM_PAT(0, 0, 2), D_13 },
+       PATTERN_END
+};
+#endif
+
 volatile unsigned char braking;
 static unsigned char dim_mode, towbar_mode;
 
@@ -104,6 +115,9 @@ void set_panic_mode()
 
 pattern_t *pwmled_pattern_select()
 {
+#ifdef TEST_PATTERN
+       return tmp_pattern;
+#endif
        if (battery_critical)
                return slow_pattern;