X-Git-Url: https://www.fi.muni.cz/~kas/git//home/kas/public_html/git/?a=blobdiff_plain;f=pattern.c;h=fb74ae0204426579429c39a59af78d97ef9f34f4;hb=397cd6dcd653cecedb9448b4afc092dc2ec47e8b;hp=363868610dfc8f3487c15ce694c5c76f60f943ad;hpb=243ecacbd6e12a329b29b19cc37200829ac17276;p=bike-lights.git diff --git a/pattern.c b/pattern.c index 3638686..fb74ae0 100644 --- a/pattern.c +++ b/pattern.c @@ -23,11 +23,14 @@ pattern_t blink_pattern[] = { }; pattern_t mode1_pattern[] = { - { 1, 0x1 }, + { 3, 0x1 }, { 0, 0x1 }, - { 4, 0x1 }, + { 3, 0x1 }, + { 0, 0x8 }, + { 1, 0x1 }, { 0, 0x1 }, { 1, 0x1 }, + { 0, 0x8 }, PATTERN_END }; @@ -123,17 +126,10 @@ static inline pattern_t *pattern_select(unsigned char n) return off_pattern; // Don't mess with non-enabled LEDs if (n == 2) { - if (test_running) { - log_byte(0xF7); - log_flush(); - return off_pattern; - } else { - test_running = 1; - log_byte(0xF6); - return mode1_pattern; - } + return mode1_pattern; } - return number_pattern(1+ambient_zone); + // return number_pattern(1+ambient_zone); + return off_pattern; } void patterns_next_tick() @@ -154,3 +150,7 @@ void patterns_next_tick() } } +void led_set_status(unsigned char status) +{ + led_set_pattern(N_PWMLEDS+1, number_pattern(status)); +}