Skip to content

Commit 44e54ac

Browse files
lurchwill-v-pi
authored andcommitted
Fix pico_status_led to change the color of an already-on colored LED (raspberrypi#2632)
Partially fixes raspberrypi#2630, as it doesn't take care of the required delay between setting the LED
1 parent cc5c50a commit 44e54ac

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)