aboutsummaryrefslogtreecommitdiffstats
path: root/quantum/rgb_matrix.c
diff options
context:
space:
mode:
authorDrashna Jaelre <drashna@live.com>2019-12-25 09:54:47 -0800
committerJoel Challis <git@zvecr.com>2019-12-25 17:54:47 +0000
commit46e2b6e43d6667cc20bcccf34c71dc60048ac9b2 (patch)
treefc8a4c68c8bd7061441877c4748ab00e90a99fbd /quantum/rgb_matrix.c
parent9aedb620c51e61b0ec654ffaeb0eac2d8839b0b4 (diff)
downloadfirmware-46e2b6e43d6667cc20bcccf34c71dc60048ac9b2.tar.gz
firmware-46e2b6e43d6667cc20bcccf34c71dc60048ac9b2.tar.bz2
firmware-46e2b6e43d6667cc20bcccf34c71dc60048ac9b2.zip
Turn off RGB Matrix LEDs when keyboard sleeps (#7713)
Diffstat (limited to 'quantum/rgb_matrix.c')
-rw-r--r--quantum/rgb_matrix.c7
1 files changed, 6 insertions, 1 deletions
diff --git a/quantum/rgb_matrix.c b/quantum/rgb_matrix.c
index 55a6f74be..9bbeff833 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;