X-Git-Url: https://www.fi.muni.cz/~kas/git//home/kas/public_html/git/?p=bike-lights.git;a=blobdiff_plain;f=pattern.c;h=9999749fd2fe794952bbc16d83cc6f8704486636;hp=c2942e59c9bdbda3c7693e526b31238d82b5f7f0;hb=66dbf8c04a632ad64f68aad6c775af6a5f5b12e8;hpb=118fdccc786d1661fbc3821eb9872ca2eed1f860 diff --git a/pattern.c b/pattern.c index c2942e5..9999749 100644 --- a/pattern.c +++ b/pattern.c @@ -85,8 +85,8 @@ 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; + led_patterns[N_PWMLEDS+1] = boot_pattern; + led_counters[N_PWMLEDS+1] = boot_pattern->duration; gpio_set(GPIO_LED2, 1); test_running = 0; } @@ -123,10 +123,9 @@ static void led_set_mode(unsigned char n, unsigned char mode) { if (n < N_PWMLEDS) { pwmled_set_mode(n, mode); - } else if (n == N_PWMLEDS) { - gpio_set(GPIO_LED2, mode); + } else if (n < N_LEDS) { + gpio_set(n - N_PWMLEDS, mode); } - // TODO LED 1 } static void inline led_set_level(unsigned char n, unsigned char level)