fix(rgbled): double-buffer WS2812 strip to eliminate races (#7304)

Co-authored-by: Claude Opus 4.7 (1M context) <noreply@anthropic.com>
This commit is contained in:
Raphael Coeffic
2026-04-29 20:09:07 +10:00
committed by GitHub
co-authored by Claude Opus 4.7
parent 462b0351ef
commit ac4c4d7b6b
16 changed files with 244 additions and 169 deletions
@@ -24,10 +24,6 @@
#include "stm32_gpio.h"
#include "boards/generic_stm32/rgb_leds.h"
#include "board.h"
#if defined(LED_STRIP_GPIO)
#undef UNUSED
#include "stm32_ws2812.h"
#endif
#define __weak __attribute__((weak))
@@ -70,8 +66,8 @@ __weak void ledInit()
#if defined(FUNCTION_SWITCHES_RGB_LEDS)
__weak void fsLedRGB(uint8_t index, uint32_t color)
{
ws2812_set_color(index, GET_RED(color), \
GET_GREEN(color),GET_BLUE(color));
rgbSetLedColor(index, GET_RED(color), GET_GREEN(color), GET_BLUE(color));
rgbLedColorApply();
}
uint8_t getRGBColorIndex(uint32_t color)