summaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorJack Humbert <jack.humb@gmail.com>2016-07-06 06:24:31 +0200
committerJack Humbert <jack.humb@gmail.com>2016-07-06 06:24:31 +0200
commit3577e26fd9916ceab58779ec6323d43da54eb3b5 (patch)
tree78a82eaea2630375e9ce1c45e4e1ebd6dd439757
parent7d28d6a7bc81578bb5a83f1d55810ee3d1458e96 (diff)
downloadqmk_firmware-3577e26fd9916ceab58779ec6323d43da54eb3b5.tar.gz
qmk_firmware-3577e26fd9916ceab58779ec6323d43da54eb3b5.tar.xz
fix/annotate wait_us lines
-rw-r--r--keyboards/ergodox_ez/matrix.c12
-rw-r--r--quantum/matrix.c14
2 files changed, 14 insertions, 12 deletions
diff --git a/keyboards/ergodox_ez/matrix.c b/keyboards/ergodox_ez/matrix.c
index 9c1efa1d0..dc29cf5cd 100644
--- a/keyboards/ergodox_ez/matrix.c
+++ b/keyboards/ergodox_ez/matrix.c
@@ -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];
diff --git a/quantum/matrix.c b/quantum/matrix.c
index 094917025..3174e0739 100644
--- a/quantum/matrix.c
+++ b/quantum/matrix.c
@@ -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];