Skip to content

Commit

Permalink
Merge pull request #18 from ErgoDox-EZ/fix/rgb_matrix_toggle
Browse files Browse the repository at this point in the history
Only increment Enable status for RGB Matrix if it supports it
  • Loading branch information
fdidron authored Apr 20, 2019
2 parents 0612c99 + 0886c7c commit 0a04a0e
Showing 1 changed file with 5 additions and 0 deletions.
5 changes: 5 additions & 0 deletions quantum/rgb_matrix.c
Original file line number Diff line number Diff line change
Expand Up @@ -511,7 +511,12 @@ void rgb_matrix_set_suspend_state(bool state) {
}

void rgb_matrix_toggle(void) {
#ifdef RGB_MATRIX_EXTRA_TOG
rgb_matrix_config.enable++;
#else
rgb_matrix_config.enable ^= 1;
if (rgb_matrix_config.enable > 1) { rgb_matrix_config.enable = 0; } // make sure that if we are treating this as a bool, that it is only 1 or 0.
#endif
if (!rgb_matrix_config.enable) {
rgb_task_state = STARTING;
}
Expand Down

0 comments on commit 0a04a0e

Please sign in to comment.