aboutsummaryrefslogtreecommitdiff
path: root/quantum/matrix.c
diff options
context:
space:
mode:
authorJack Humbert <jack.humb@gmail.com>2016-07-06 00:24:31 -0400
committerJack Humbert <jack.humb@gmail.com>2016-07-06 00:24:31 -0400
commit3577e26fd9916ceab58779ec6323d43da54eb3b5 (patch)
tree78a82eaea2630375e9ce1c45e4e1ebd6dd439757 /quantum/matrix.c
parent7d28d6a7bc81578bb5a83f1d55810ee3d1458e96 (diff)
downloadqmk_firmware-3577e26fd9916ceab58779ec6323d43da54eb3b5.tar.gz
qmk_firmware-3577e26fd9916ceab58779ec6323d43da54eb3b5.zip
fix/annotate wait_us lines
Diffstat (limited to 'quantum/matrix.c')
-rw-r--r--quantum/matrix.c14
1 files changed, 2 insertions, 12 deletions
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/>.
27#include "matrix.h" 27#include "matrix.h"
28 28
29/* Set 0 if debouncing isn't needed */ 29/* Set 0 if debouncing isn't needed */
30/*
31 * This constant define not debouncing time in msecs, but amount of matrix
32 * scan loops which should be made to get stable debounced results.
33 *
34 * On Ergodox matrix scan rate is relatively low, because of slow I2C.
35 * Now it's only 317 scans/second, or about 3.15 msec/scan.
36 * According to Cherry specs, debouncing time is 5 msec.
37 *
38 * And so, there is no sense to have DEBOUNCE higher than 2.
39 */
40 30
41#ifndef DEBOUNCING_DELAY 31#ifndef DEBOUNCING_DELAY
42# define DEBOUNCING_DELAY 5 32# define DEBOUNCING_DELAY 5
@@ -168,7 +158,7 @@ uint8_t matrix_scan(void)
168 158
169 if (debouncing) { 159 if (debouncing) {
170 if (--debouncing) { 160 if (--debouncing) {
171 wait_us(1); 161 wait_ms(1);
172 } else { 162 } else {
173 for (uint8_t i = 0; i < MATRIX_ROWS; i++) { 163 for (uint8_t i = 0; i < MATRIX_ROWS; i++) {
174 matrix[i] = matrix_debouncing[i]; 164 matrix[i] = matrix_debouncing[i];
@@ -192,7 +182,7 @@ uint8_t matrix_scan(void)
192 182
193 if (debouncing) { 183 if (debouncing) {
194 if (--debouncing) { 184 if (--debouncing) {
195 wait_us(1); 185 wait_ms(1);
196 } else { 186 } else {
197 for (uint8_t i = 0; i < MATRIX_COLS; i++) { 187 for (uint8_t i = 0; i < MATRIX_COLS; i++) {
198 matrix_reversed[i] = matrix_reversed_debouncing[i]; 188 matrix_reversed[i] = matrix_reversed_debouncing[i];