]> www.fi.muni.cz Git - bike-lights.git/commitdiff
boot pattern
authorJan "Yenya" Kasprzak <kas@fi.muni.cz>
Tue, 28 Aug 2012 22:25:48 +0000 (00:25 +0200)
committerJan "Yenya" Kasprzak <kas@fi.muni.cz>
Tue, 28 Aug 2012 22:25:48 +0000 (00:25 +0200)
pattern.c

index 0245c3b679cb8e08080b67c1f08f38193cf9b02c..efe2ea4e1af48a6b8007f90ab99f6c35534b7eb8 100644 (file)
--- a/pattern.c
+++ b/pattern.c
@@ -22,6 +22,26 @@ pattern_t blink_pattern[] = {
        PATTERN_END
 };
 
+pattern_t boot_pattern[] = {
+       { 1, 0x6 },
+       { 0, 0x6 },
+       { 1, 0x3 },
+       { 0, 0x3 },
+       { 1, 0x2 },
+       { 0, 0x2 },
+       { 1, 0x1 },
+       { 0, 0x1 },
+       { 1, 0x1 },
+       { 0, 0x1 },
+       { 1, 0x1 },
+       { 0, 0x1 },
+       { 1, 0x1 },
+       { 0, 0x1 },
+       { 1, 0x10 },
+       { 0, 0x10 },
+       PATTERN_END
+};
+
 pattern_t pattern_num[] = {
        { 1, 0x1 },
        { 0, 0x4 },
@@ -52,11 +72,13 @@ void pattern_init()
                led_counters[i] = 0;
                led_patterns[i] = off_pattern;
        }
+       led_patterns[N_PWMLEDS] = boot_pattern;
+       led_counters[N_PWMLEDS] = boot_pattern->duration;
+       gpio_set(GPIO_LED2, 1);
 }
 
 static inline pattern_t *pattern_select(unsigned char n)
 {
-       log_byte(ambient_zone);
        return pattern_num + sizeof(pattern_num)/sizeof(pattern_t)
                - 1 - 2*(1+ambient_zone);;
 }