summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorDan Halbert <halbert@halwitz.org>2019-03-27 11:08:31 -0400
committerGitHub <noreply@github.com>2019-03-27 11:08:31 -0400
commit6cd874cc47664ed150dfe747a16caf4e8e6a4d9b (patch)
tree0e4ad7a4beab43f0d02919e0054b55fe86150afa
parent3f42a49a6b9fe416b739757e6e72574abc58c4fd (diff)
parent503642e7949ea0665bc3d34daeaa9d333093428f (diff)
Merge pull request #1711 from tannewt/immediate_rgb_led_brightness
Make status LED brightness change immediate.
-rw-r--r--supervisor/shared/rgb_led_status.c6
1 files changed, 6 insertions, 0 deletions
diff --git a/supervisor/shared/rgb_led_status.c b/supervisor/shared/rgb_led_status.c
index 186e33ab9..df9fdf8d9 100644
--- a/supervisor/shared/rgb_led_status.c
+++ b/supervisor/shared/rgb_led_status.c
@@ -197,6 +197,12 @@ uint32_t color_brightness(uint32_t color, uint8_t brightness) {
void set_rgb_status_brightness(uint8_t level){
#if defined(MICROPY_HW_NEOPIXEL) || (defined(MICROPY_HW_APA102_MOSI) && defined(MICROPY_HW_APA102_SCK))
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);
#endif
}