diff --git a/main.c b/main.c index 8c19336..7f35a17 100644 --- a/main.c +++ b/main.c @@ -35,8 +35,10 @@ #include "usb_cdcacm.h" // USB CDC ACM utilities #include "led_ws2812b.h" // WS2812b LEDs utilities -/* flag set in interrupts to be processed in main taks */ -volatile bool button_flag = false; // button has been presse +/* flag set in interrupts to be processed in main task */ +volatile bool button_flag = false; // button has been pressed + +uint8_t clock_leds[WS2812B_LEDS*3] = {0}; // RGB values for the WS2812b clock LEDs /* default output (i.e. for printf) */ int _write(int file, char *ptr, int len) @@ -84,6 +86,34 @@ void led_toggle(void) gpio_toggle(LED_PORT, LED_PIN); } +/* switch off all clock LEDs */ +static void leds_clear(void) +{ + // set all colors of all LEDs to 0 + for (uint16_t i=0; i