summaryrefslogtreecommitdiff
path: root/keyboards/ergodox_ez
diff options
context:
space:
mode:
authorJack Humbert2016-07-06 18:05:50 -0400
committerJack Humbert2016-07-06 18:05:50 -0400
commitc88207884b5fb16c8955b54b4331fc605158b9f2 (patch)
tree3c929a4e018db257b7f0238f2a52d21600352bca /keyboards/ergodox_ez
parenteb6e17be6fc378fdfb8c5c2c7253c17ffc07d225 (diff)
parent5baaf871bbdd6667625860b0daef7fe9a91e08db (diff)
Merge branch 'master' into lets-split-support
Diffstat (limited to 'keyboards/ergodox_ez')
-rw-r--r--keyboards/ergodox_ez/matrix.c12
1 files changed, 12 insertions, 0 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];