Skip to content

Commit bdee6cf

Browse files
committed
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
1 parent fe6e03f commit bdee6cf

File tree

1 file changed

+3
-6
lines changed

1 file changed

+3
-6
lines changed

supervisor/shared/status_leds.c

Lines changed: 3 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -324,12 +324,9 @@ uint32_t color_brightness(uint32_t color, uint8_t brightness) {
324324
void set_status_brightness(uint8_t level) {
325325
#if CIRCUITPY_STATUS_LED
326326
rgb_status_brightness = level;
327-
uint32_t current_color = current_status_color;
328-
// Temporarily change the current color global to force the new_status_color call to update the
329-
// LED. Usually duplicate calls of the same color are ignored without regard to brightness
330-
// changes.
331-
current_status_color = 0;
332-
new_status_color(current_color);
327+
// This is only called by user code and we're never controlling the status
328+
// LED when user code is running. So, we don't need to update the current
329+
// state (there is none.)
333330
#endif
334331
}
335332

0 commit comments

Comments
 (0)