]> git.donarmstrong.com Git - qmk_firmware.git/commitdiff
Customizable LED test duration (#3086)
authorErez Zukerman <bulk@ezuk.org>
Thu, 31 May 2018 03:23:12 +0000 (23:23 -0400)
committerJack Humbert <jack.humb@gmail.com>
Thu, 31 May 2018 03:23:12 +0000 (23:23 -0400)
* Customizable LED test duration

Code by Jack. :)

* only need an unit8_t

quantum/rgb_matrix.c

index 992ce99de986f1b32421423b9c3552019197ee16..8c41fc54d21ba628bb4ae91ecb0c468aa9a1be78 100644 (file)
@@ -149,8 +149,9 @@ void rgb_matrix_set_suspend_state(bool state) {
 
 void rgb_matrix_test(void) {
     // Mask out bits 4 and 5
-    // This 2-bit value will stay the same for 16 ticks.
-    switch ( (g_tick & 0x30) >> 4 )
+    // Increase the factor to make the test animation slower (and reduce to make it faster)
+    uint8_t factor = 10;
+    switch ( (g_tick & (0b11 << factor)) >> factor )
     {
         case 0:
         {