From 9e9a85c1426650148d0d83c900e432003ff174fb Mon Sep 17 00:00:00 2001 From: tmk Date: Tue, 5 Mar 2013 19:18:01 +0900 Subject: Fix ghost block and remove matrix_has_ghost() --- keyboard/hbkb/Makefile.lufa | 1 + keyboard/hbkb/matrix.c | 15 ++------------- 2 files changed, 3 insertions(+), 13 deletions(-) (limited to 'keyboard') diff --git a/keyboard/hbkb/Makefile.lufa b/keyboard/hbkb/Makefile.lufa index c73a0ca7d1..33366d7208 100644 --- a/keyboard/hbkb/Makefile.lufa +++ b/keyboard/hbkb/Makefile.lufa @@ -99,6 +99,7 @@ F_USB = $(F_CPU) # MOUSEKEY_ENABLE = yes # Mouse keys EXTRAKEY_ENABLE = yes # Audio control and System control +CONSOLE_ENABLE = yes # Console for debug #NKRO_ENABLE = yes # USB Nkey Rollover #PS2_MOUSE_ENABLE = yes # PS/2 mouse(TrackPoint) support diff --git a/keyboard/hbkb/matrix.c b/keyboard/hbkb/matrix.c index d7c0663642..f3a0cde5f3 100644 --- a/keyboard/hbkb/matrix.c +++ b/keyboard/hbkb/matrix.c @@ -147,18 +147,6 @@ bool matrix_is_modified(void) return false; } -inline -bool matrix_has_ghost(void) -{ -#ifdef MATRIX_HAS_GHOST - for (uint8_t i = 0; i < MATRIX_ROWS; i++) { - if (matrix_has_ghost_in_row(i)) - return true; - } -#endif - return false; -} - inline bool matrix_is_on(uint8_t row, uint8_t col) { @@ -217,7 +205,8 @@ static bool matrix_has_ghost_in_row(uint8_t row) // ghost exists in case same state as other row for (uint8_t i=0; i < MATRIX_ROWS; i++) { - if (i != row && (matrix[i] & matrix[row]) == matrix[row]) + //if (i != row && (matrix[i] & matrix[row]) == matrix[row]) + if (i != row && (matrix[i] & matrix[row])) return true; } return false; -- cgit v1.2.1 From 81d2753ab07890532ea8c4bd6a68de3e5e08ca33 Mon Sep 17 00:00:00 2001 From: tmk Date: Tue, 5 Mar 2013 21:20:39 +0900 Subject: Remove matrix_key_count() from matrix.h --- keyboard/hbkb/matrix.c | 14 -------------- 1 file changed, 14 deletions(-) (limited to 'keyboard') diff --git a/keyboard/hbkb/matrix.c b/keyboard/hbkb/matrix.c index f3a0cde5f3..a24d24b8c3 100644 --- a/keyboard/hbkb/matrix.c +++ b/keyboard/hbkb/matrix.c @@ -182,19 +182,6 @@ void matrix_print(void) } } -uint8_t matrix_key_count(void) -{ - uint8_t count = 0; - for (uint8_t i = 0; i < MATRIX_ROWS; i++) { -#if (MATRIX_COLS <= 8) - count += bitpop(matrix[i]); -#else - count += bitpop16(matrix[i]); -#endif - } - return count; -} - #ifdef MATRIX_HAS_GHOST inline static bool matrix_has_ghost_in_row(uint8_t row) @@ -205,7 +192,6 @@ static bool matrix_has_ghost_in_row(uint8_t row) // ghost exists in case same state as other row for (uint8_t i=0; i < MATRIX_ROWS; i++) { - //if (i != row && (matrix[i] & matrix[row]) == matrix[row]) if (i != row && (matrix[i] & matrix[row])) return true; } -- cgit v1.2.1