Skip to content

Commit 6b395cc

Browse files
authored
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
1 parent 87c9c01 commit 6b395cc

File tree

1 file changed

+2
-1
lines changed

1 file changed

+2
-1
lines changed

src/rp2_common/pico_status_led/status_led.c

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -80,7 +80,8 @@ bool colored_status_led_set_state(bool led_on) {
8080
if (colored_status_led_supported()) {
8181
#if COLORED_STATUS_LED_USING_WS2812_PIO
8282
success = true;
83-
if (led_on && !colored_status_led_on) {
83+
if (led_on) {
84+
// Turn the LED "on" even if it was already on, as the color might have changed
8485
success = set_ws2812(colored_status_led_on_color);
8586
} else if (!led_on && colored_status_led_on) {
8687
success = set_ws2812(0);

0 commit comments

Comments
 (0)