Skip to content

Commit 6cd874c

Browse files
authored
Merge pull request adafruit#1711 from tannewt/immediate_rgb_led_brightness
Make status LED brightness change immediate.
2 parents 3f42a49 + 503642e commit 6cd874c

File tree

1 file changed

+6
-0
lines changed

1 file changed

+6
-0
lines changed

supervisor/shared/rgb_led_status.c

Lines changed: 6 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -197,6 +197,12 @@ uint32_t color_brightness(uint32_t color, uint8_t brightness) {
197197
void set_rgb_status_brightness(uint8_t level){
198198
#if defined(MICROPY_HW_NEOPIXEL) || (defined(MICROPY_HW_APA102_MOSI) && defined(MICROPY_HW_APA102_SCK))
199199
rgb_status_brightness = level;
200+
uint32_t current_color = current_status_color;
201+
// Temporarily change the current color global to force the new_status_color call to update the
202+
// LED. Usually duplicate calls of the same color are ignored without regard to brightness
203+
// changes.
204+
current_status_color = 0;
205+
new_status_color(current_color);
200206
#endif
201207
}
202208

0 commit comments

Comments
 (0)