From af9d0d685ac13cf0bcb2fc61798c8feaf2eb6338 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?King=20K=C3=A9vin?= Date: Thu, 14 Jul 2022 19:00:02 +0200 Subject: [PATCH] app: add WS2812B --- application.c | 8 ++++++++ 1 file changed, 8 insertions(+) diff --git a/application.c b/application.c index c110a0a..c842a7d 100644 --- a/application.c +++ b/application.c @@ -35,6 +35,7 @@ #include "terminal.h" // handle the terminal interface #include "menu.h" // menu utilities #include "font.h" // to draw text +#include "led_ws2812b.h" // control WS2812b LEDs /** watchdog period in ms */ #define WATCHDOG_PERIOD 10000 @@ -934,6 +935,13 @@ void main(void) nvic_enable_irq(GPIO_NVIC_EXTI_IRQ(DIAL_SWITCH_PIN)); // enable interrupt puts_debug("OK\n"); + puts_debug("setup WS2812b LED matrix: "); + led_ws2812b_setup(); // configure peripheral for communication with WS2812b LEDs + led_ws2812b_set_rgb(0, 0xff, 0, 0); // set test color + led_ws2812b_set_rgb(1, 0, 0xff, 0); // set test color + led_ws2812b_set_rgb(2, 0, 0, 0xff); // set test color + puts_debug("OK\n"); + puts_debug("setup RGB matrix: "); // configure pin for output enable rcc_periph_clock_enable(GPIO_RCC(RGBMATRIX_OE_PIN)); // enable clock for GPIO port peripheral