Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

[Bug] Fix RGB/LED Matrix Suspend code #14084

Merged
merged 1 commit into from
Aug 20, 2021
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
5 changes: 3 additions & 2 deletions quantum/led_matrix/led_matrix.c
Original file line number Diff line number Diff line change
Expand Up @@ -459,8 +459,9 @@ void led_matrix_init(void) {

void led_matrix_set_suspend_state(bool state) {
#ifdef LED_DISABLE_WHEN_USB_SUSPENDED
if (state && is_keyboard_master()) {
led_matrix_set_value_all(0); // turn off all LEDs when suspending
if (state && !suspend_state && is_keyboard_master()) { // only run if turning off, and only once
led_task_effect(0); // turn off all LEDs when suspending
led_task_flush(0); // and actually flash led state to LEDs
}
suspend_state = state;
#endif
Expand Down
5 changes: 3 additions & 2 deletions quantum/rgb_matrix/rgb_matrix.c
Original file line number Diff line number Diff line change
Expand Up @@ -501,8 +501,9 @@ void rgb_matrix_init(void) {

void rgb_matrix_set_suspend_state(bool state) {
#ifdef RGB_DISABLE_WHEN_USB_SUSPENDED
if (state) {
rgb_matrix_set_color_all(0, 0, 0); // turn off all LEDs when suspending
if (state && !suspend_state) { // only run if turning off, and only once
rgb_task_render(0); // turn off all LEDs when suspending
rgb_task_flush(0); // and actually flash led state to LEDs
}
suspend_state = state;
#endif
Expand Down