feat: Support for WS2812 RGB LEDs (#3909)
Co-authored-by: 3djc <lesitewebdejc@hotmail.com>
This commit is contained in:
@@ -19,6 +19,8 @@
|
||||
* GNU General Public License for more details.
|
||||
*/
|
||||
|
||||
#include "stm32_ws2812.h"
|
||||
|
||||
#include "hal/adc_driver.h"
|
||||
#include "hal/trainer_driver.h"
|
||||
#include "hal/switch_driver.h"
|
||||
@@ -28,6 +30,7 @@
|
||||
#include "boards/generic_stm32/module_ports.h"
|
||||
#include "boards/generic_stm32/intmodule_heartbeat.h"
|
||||
#include "boards/generic_stm32/analog_inputs.h"
|
||||
#include "boards/generic_stm32/rgb_leds.h"
|
||||
|
||||
#include "debug.h"
|
||||
#include "rtc.h"
|
||||
@@ -224,6 +227,16 @@ void boardInit()
|
||||
timersInit();
|
||||
usbInit();
|
||||
|
||||
#if defined(LED_STRIP_GPIO)
|
||||
extern const stm32_pulse_timer_t _led_timer;
|
||||
|
||||
ws2812_init(&_led_timer, LED_STRIP_LENGTH);
|
||||
for (uint8_t i = 0; i < LED_STRIP_LENGTH; i++) {
|
||||
ws2812_set_color(i, 0, 0, 50);
|
||||
}
|
||||
ws2812_update(&_led_timer);
|
||||
#endif
|
||||
|
||||
#if defined(DEBUG)
|
||||
serialSetMode(SP_AUX1, UART_MODE_DEBUG); // indicate AUX1 is used
|
||||
serialInit(SP_AUX1, UART_MODE_DEBUG); // early AUX1 init
|
||||
|
||||
Reference in New Issue
Block a user