Fix pico_status_led to change the color of an already-on colored LED (#2632)

Partially fixes #2630, as it doesn't take care of the required delay between setting the LED
This commit is contained in:
Andrew Scheller 2025-09-15 19:09:21 +01:00 committed by GitHub
parent 87c9c013fe
commit 6b395cce04
No known key found for this signature in database
GPG key ID: B5690EEEBB952194

View file

@ -80,7 +80,8 @@ bool colored_status_led_set_state(bool led_on) {
if (colored_status_led_supported()) { if (colored_status_led_supported()) {
#if COLORED_STATUS_LED_USING_WS2812_PIO #if COLORED_STATUS_LED_USING_WS2812_PIO
success = true; success = true;
if (led_on && !colored_status_led_on) { if (led_on) {
// Turn the LED "on" even if it was already on, as the color might have changed
success = set_ws2812(colored_status_led_on_color); success = set_ws2812(colored_status_led_on_color);
} else if (!led_on && colored_status_led_on) { } else if (!led_on && colored_status_led_on) {
success = set_ws2812(0); success = set_ws2812(0);