summaryrefslogtreecommitdiff
path: root/keyboards/ergodox_ez/matrix.c
diff options
context:
space:
mode:
authorJosh Colbeck <skrymir@gmail.com>2016-07-04 15:41:58 -0500
committerJosh Colbeck <skrymir@gmail.com>2016-07-04 15:41:58 -0500
commita5fb2b58a5fc328da7eea42cb73c668f3b5d0f7e (patch)
tree31762ea16ad4e7aceb86d3939ebe25839becc77a /keyboards/ergodox_ez/matrix.c
parent497b92c3bd3ee480e59d08f2a6fb1b780172681c (diff)
parent9e01b219f32b0086728c10658928b8bffcc26ef7 (diff)
Merge remote-tracking branch 'jackhumbert/master' into patch-1
Diffstat (limited to 'keyboards/ergodox_ez/matrix.c')
-rw-r--r--keyboards/ergodox_ez/matrix.c6
1 files changed, 3 insertions, 3 deletions
diff --git a/keyboards/ergodox_ez/matrix.c b/keyboards/ergodox_ez/matrix.c
index b87fddbad7..9c1efa1d05 100644
--- a/keyboards/ergodox_ez/matrix.c
+++ b/keyboards/ergodox_ez/matrix.c
@@ -27,7 +27,7 @@ along with this program. If not, see <http://www.gnu.org/licenses/>.
#include <stdint.h>
#include <stdbool.h>
#include <avr/io.h>
-#include <util/delay.h>
+#include "wait.h"
#include "action_layer.h"
#include "print.h"
#include "debug.h"
@@ -166,6 +166,7 @@ uint8_t matrix_scan(void)
for (uint8_t i = 0; i < MATRIX_ROWS; i++) {
select_row(i);
+ wait_us(30); // without this wait read unstable value.
matrix_row_t cols = read_cols(i);
if (matrix_debouncing[i] != cols) {
matrix_debouncing[i] = cols;
@@ -179,7 +180,7 @@ uint8_t matrix_scan(void)
if (debouncing) {
if (--debouncing) {
- _delay_ms(1);
+ wait_us(1);
} else {
for (uint8_t i = 0; i < MATRIX_ROWS; i++) {
matrix[i] = matrix_debouncing[i];
@@ -267,7 +268,6 @@ static matrix_row_t read_cols(uint8_t row)
return data;
}
} else {
- _delay_us(30); // without this wait read unstable value.
// read from teensy
return
(PINF&(1<<0) ? 0 : (1<<0)) |