From df5f02b388eba0ca31e6ee6528a83d2720bfb3b9 Mon Sep 17 00:00:00 2001 From: Drashna Jaelre Date: Tue, 24 Dec 2019 19:52:54 -0800 Subject: [PATCH] Turn off RGB Matrix LEDs when keyboard sleeps --- quantum/rgb_matrix.c | 7 ++++++- 1 file changed, 6 insertions(+), 1 deletion(-) diff --git a/quantum/rgb_matrix.c b/quantum/rgb_matrix.c index 55a6f74be75c..9bbeff833269 100644 --- a/quantum/rgb_matrix.c +++ b/quantum/rgb_matrix.c @@ -417,7 +417,12 @@ void rgb_matrix_init(void) { eeconfig_debug_rgb_matrix(); // display current eeprom values } -void rgb_matrix_set_suspend_state(bool state) { g_suspend_state = state; } +void rgb_matrix_set_suspend_state(bool state) { + if (RGB_DISABLE_WHEN_USB_SUSPENDED && state) { + rgb_matrix_set_color_all(0, 0, 0); // turn off all LEDs when suspending + } + g_suspend_state = state; +} void rgb_matrix_toggle(void) { rgb_matrix_config.enable ^= 1;