From 8960e8c9da39844e15882e20308b4f57ee81de73 Mon Sep 17 00:00:00 2001 From: Kai Ryu Date: Mon, 11 Aug 2014 16:17:42 +0900 Subject: [PATCH] Fix bug of debouncing --- keyboard/tentapad/matrix.c | 13 ++++++++++++- 1 file changed, 12 insertions(+), 1 deletion(-) diff --git a/keyboard/tentapad/matrix.c b/keyboard/tentapad/matrix.c index 3f58aa69..438b8c41 100644 --- a/keyboard/tentapad/matrix.c +++ b/keyboard/tentapad/matrix.c @@ -39,6 +39,7 @@ along with this program. If not, see . /* matrix state(1:on, 0:off) */ static matrix_row_t matrix = 0; +static matrix_row_t matrix_debouncing = 0; static matrix_row_t debouncing = 0; static uint16_t debouncing_last[MATRIX_COLS]; @@ -91,7 +92,7 @@ uint8_t matrix_scan(void) { matrix_row_t cols = read_cols(); for (uint8_t col = 0; col < MATRIX_COLS; col++) { - if ((cols & (1< DEBOUNCE) { + // released + matrix &= ~(1<