summaryrefslogtreecommitdiff
path: root/quantum/rgb_matrix.c
diff options
context:
space:
mode:
authorFlorian Didron <fdidron@users.noreply.github.com>2019-04-21 06:28:25 +0900
committerGitHub <noreply@github.com>2019-04-21 06:28:25 +0900
commit0a04a0e4191419455fadfeadaaec6696d9dea890 (patch)
tree1e2c46e9f13be6cd6f36c5d19750d811daa605f7 /quantum/rgb_matrix.c
parent0612c9968bf34fc1acde2b44ac9fd590f97ffe34 (diff)
parent0886c7ce573d2d1346b90bc2a9785242bae70dc2 (diff)
Merge pull request #18 from ErgoDox-EZ/fix/rgb_matrix_toggle
Only increment Enable status for RGB Matrix if it supports it
Diffstat (limited to 'quantum/rgb_matrix.c')
-rw-r--r--quantum/rgb_matrix.c5
1 files changed, 5 insertions, 0 deletions
diff --git a/quantum/rgb_matrix.c b/quantum/rgb_matrix.c
index a1193d4c07..3e49f9fc0a 100644
--- a/quantum/rgb_matrix.c
+++ b/quantum/rgb_matrix.c
@@ -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;
}