From bdee6cf3b627db6e1b33265092cdc0330c9cf5f4 Mon Sep 17 00:00:00 2001 From: Scott Shawcroft Date: Thu, 17 Feb 2022 14:21:03 -0800 Subject: [PATCH] Don't update status LED color on brightness change Brightness changes now happen when the LED isn't active or initialized. When not init, CP may crash. Fixes #5872 --- supervisor/shared/status_leds.c | 9 +++------ 1 file changed, 3 insertions(+), 6 deletions(-) diff --git a/supervisor/shared/status_leds.c b/supervisor/shared/status_leds.c index 08b2935cb6..07ff9634e9 100644 --- a/supervisor/shared/status_leds.c +++ b/supervisor/shared/status_leds.c @@ -324,12 +324,9 @@ uint32_t color_brightness(uint32_t color, uint8_t brightness) { void set_status_brightness(uint8_t level) { #if CIRCUITPY_STATUS_LED rgb_status_brightness = level; - uint32_t current_color = current_status_color; - // Temporarily change the current color global to force the new_status_color call to update the - // LED. Usually duplicate calls of the same color are ignored without regard to brightness - // changes. - current_status_color = 0; - new_status_color(current_color); + // This is only called by user code and we're never controlling the status + // LED when user code is running. So, we don't need to update the current + // state (there is none.) #endif }