]> git.donarmstrong.com Git - qmk_firmware.git/commitdiff
fix/annotate wait_us lines
authorJack Humbert <jack.humb@gmail.com>
Wed, 6 Jul 2016 04:24:31 +0000 (00:24 -0400)
committerJack Humbert <jack.humb@gmail.com>
Wed, 6 Jul 2016 04:24:31 +0000 (00:24 -0400)
keyboards/ergodox_ez/matrix.c
quantum/matrix.c

index 9c1efa1d05acb4bee691f771c943316b57ac93bf..dc29cf5cd03c748433878b79ab3567acdd1ffedd 100644 (file)
@@ -39,6 +39,17 @@ along with this program.  If not, see <http://www.gnu.org/licenses/>.
 #include  "timer.h"
 #endif
 
+/*
+ * This constant define not debouncing time in msecs, but amount of matrix
+ * scan loops which should be made to get stable debounced results.
+ *
+ * On Ergodox matrix scan rate is relatively low, because of slow I2C.
+ * Now it's only 317 scans/second, or about 3.15 msec/scan.
+ * According to Cherry specs, debouncing time is 5 msec.
+ *
+ * And so, there is no sense to have DEBOUNCE higher than 2.
+ */
+
 #ifndef DEBOUNCE
 #   define DEBOUNCE    5
 #endif
@@ -181,6 +192,7 @@ uint8_t matrix_scan(void)
     if (debouncing) {
         if (--debouncing) {
             wait_us(1);
+            // this should be wait_ms(1) but has been left as-is at EZ's request
         } else {
             for (uint8_t i = 0; i < MATRIX_ROWS; i++) {
                 matrix[i] = matrix_debouncing[i];
index 094917025527a0558f09801d8d82a98c2f4468da..3174e07390ca587351b842010f9a14b5f89d367c 100644 (file)
@@ -27,16 +27,6 @@ along with this program.  If not, see <http://www.gnu.org/licenses/>.
 #include "matrix.h"
 
 /* Set 0 if debouncing isn't needed */
-/*
- * This constant define not debouncing time in msecs, but amount of matrix
- * scan loops which should be made to get stable debounced results.
- *
- * On Ergodox matrix scan rate is relatively low, because of slow I2C.
- * Now it's only 317 scans/second, or about 3.15 msec/scan.
- * According to Cherry specs, debouncing time is 5 msec.
- *
- * And so, there is no sense to have DEBOUNCE higher than 2.
- */
 
 #ifndef DEBOUNCING_DELAY
 #   define DEBOUNCING_DELAY 5
@@ -168,7 +158,7 @@ uint8_t matrix_scan(void)
 
     if (debouncing) {
         if (--debouncing) {
-            wait_us(1);
+            wait_ms(1);
         } else {
             for (uint8_t i = 0; i < MATRIX_ROWS; i++) {
                 matrix[i] = matrix_debouncing[i];
@@ -192,7 +182,7 @@ uint8_t matrix_scan(void)
 
     if (debouncing) {
         if (--debouncing) {
-            wait_us(1);
+            wait_ms(1);
         } else {
             for (uint8_t i = 0; i < MATRIX_COLS; i++) {
                 matrix_reversed[i] = matrix_reversed_debouncing[i];