X-Git-Url: https://www.fi.muni.cz/~kas/git//home/kas/public_html/git/?a=blobdiff_plain;f=firmware%2Fpattern.c;h=f5f8fc6f8003ab9a92761e4d9992e46b0081c022;hb=0d98bdd496538991b106bc64c45df8e89f23ea32;hp=56f4781bee1131e2209ce8010de5d0847117a1d5;hpb=b081e2b479997f8dbe67b400305bff554610ab24;p=bike-lights.git diff --git a/firmware/pattern.c b/firmware/pattern.c index 56f4781..f5f8fc6 100644 --- a/firmware/pattern.c +++ b/firmware/pattern.c @@ -9,6 +9,11 @@ pattern_t off_pattern[] = { { 0, PATTERN_FOREVER }, }; +pattern_t zero_pattern[] = { + { 0, 0x10 }, + PATTERN_END +}; + pattern_t on_pattern[] = { { 1, PATTERN_FOREVER }, }; @@ -20,9 +25,9 @@ pattern_t blink_pattern[] = { }; pattern_t mode1_pattern[] = { - { 4, 0x1 }, + { 2, 0x1 }, { 0, 0x1 }, - { 4, 0x1 }, + { 2, 0x1 }, { 0, 0x8 }, { 1, 0x1 }, { 0, 0x1 }, @@ -102,7 +107,7 @@ void pattern_init() unsigned char i; for (i = 0; i < N_LEDS; i++) - led_set_pattern(i, off_pattern); + led_set_pattern(i, zero_pattern); led_set_pattern(N_PWMLEDS+1, boot_pattern); test_running = 0; @@ -119,9 +124,7 @@ pattern_t *number_pattern(unsigned char num) static inline pattern_t *pattern_select(unsigned char n) { - if (n < N_PWMLEDS && !pwmled_enabled(n)) - return off_pattern; // Don't mess with non-enabled LEDs - else if (n < N_PWMLEDS) + if (n < N_PWMLEDS) return mode1_pattern; else if (n == 3) return status_pattern_select(0); @@ -149,7 +152,3 @@ void patterns_next_tick() } } -void led_set_status(unsigned char status) -{ - led_set_pattern(N_PWMLEDS+1, number_pattern(status)); -}