mirror of
https://github.com/raspberrypi/pico-sdk.git
synced 2025-12-10 07:14:36 +01:00
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:
parent
87c9c013fe
commit
6b395cce04
1 changed files with 2 additions and 1 deletions
|
|
@ -80,7 +80,8 @@ bool colored_status_led_set_state(bool led_on) {
|
|||
if (colored_status_led_supported()) {
|
||||
#if COLORED_STATUS_LED_USING_WS2812_PIO
|
||||
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);
|
||||
} else if (!led_on && colored_status_led_on) {
|
||||
success = set_ws2812(0);
|
||||
|
|
|
|||
Loading…
Add table
Reference in a new issue