]> git.donarmstrong.com Git - qmk_firmware.git/blobdiff - keyboards/infinity60/matrix.c
several improvements for mitosis:datagrok (#1960)
[qmk_firmware.git] / keyboards / infinity60 / matrix.c
index 62c165aa5339747179f83b5be3c74f0ab0d82291..b6ccf86c3a74e7ab130a3aad59e7668d344e9b4c 100644 (file)
@@ -62,6 +62,8 @@ void matrix_init(void)
 #endif
     memset(matrix, 0, MATRIX_ROWS);
     memset(matrix_debouncing, 0, MATRIX_ROWS);
+
+    matrix_init_quantum();
 }
 
 uint8_t matrix_scan(void)
@@ -96,7 +98,12 @@ uint8_t matrix_scan(void)
         }
     #endif
 
-        wait_us(1); // need wait to settle pin state
+        // need wait to settle pin state
+        // if you wait too short, or have a too high update rate
+        // the keyboard might freeze, or there might not be enough
+        // processing power to update the LCD screen properly.
+        // 20us, or two ticks at 100000Hz seems to be OK
+        wait_us(20);
 
         // read col data
         data = (palReadPort(GPIOD)>>1);
@@ -141,6 +148,7 @@ uint8_t matrix_scan(void)
         }
         debouncing = false;
     }
+    matrix_scan_quantum();
     return 1;
 }