Skip to content

Commit

Permalink
Turn off RGB Matrix LEDs when keyboard sleeps (qmk#7713)
Browse files Browse the repository at this point in the history
  • Loading branch information
drashna authored and patrl committed Dec 29, 2019
1 parent 0d14902 commit 59dc91d
Showing 1 changed file with 6 additions and 1 deletion.
7 changes: 6 additions & 1 deletion quantum/rgb_matrix.c
Original file line number Diff line number Diff line change
Expand Up @@ -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;
Expand Down

0 comments on commit 59dc91d

Please sign in to comment.