aboutsummaryrefslogtreecommitdiff
path: root/keyboard/gh60
diff options
context:
space:
mode:
authortmk <nobody@nowhere>2013-03-27 17:15:06 +0900
committertmk <nobody@nowhere>2013-03-27 17:15:06 +0900
commit2795b7a0a30c351a85f17cb4c0b414297e096282 (patch)
treed456c2a781ec6f81d3ed7ef2e567c952e121daf1 /keyboard/gh60
parent969cc4f812e3f86213f97adf340e3c7160fc639e (diff)
downloadqmk_firmware-2795b7a0a30c351a85f17cb4c0b414297e096282.tar.gz
qmk_firmware-2795b7a0a30c351a85f17cb4c0b414297e096282.zip
Fix debouncing on gh60, hbkb, macway
Diffstat (limited to 'keyboard/gh60')
-rw-r--r--keyboard/gh60/matrix.c14
1 files changed, 5 insertions, 9 deletions
diff --git a/keyboard/gh60/matrix.c b/keyboard/gh60/matrix.c
index 3ba6801fb..a2bd70e4b 100644
--- a/keyboard/gh60/matrix.c
+++ b/keyboard/gh60/matrix.c
@@ -34,10 +34,8 @@ along with this program. If not, see <http://www.gnu.org/licenses/>.
34static uint8_t debouncing = DEBOUNCE; 34static uint8_t debouncing = DEBOUNCE;
35 35
36/* matrix state(1:on, 0:off) */ 36/* matrix state(1:on, 0:off) */
37static matrix_row_t *matrix; 37static matrix_row_t matrix[MATRIX_ROWS];
38static matrix_row_t *matrix_debouncing; 38static matrix_row_t matrix_debouncing[MATRIX_ROWS];
39static matrix_row_t matrix0[MATRIX_ROWS];
40static matrix_row_t matrix1[MATRIX_ROWS];
41 39
42static matrix_row_t read_cols(void); 40static matrix_row_t read_cols(void);
43static void init_cols(void); 41static void init_cols(void);
@@ -64,8 +62,6 @@ void matrix_init(void)
64 init_cols(); 62 init_cols();
65 63
66 // initialize matrix state: all keys off 64 // initialize matrix state: all keys off
67 matrix = matrix0;
68 matrix_debouncing = matrix1;
69 for (uint8_t i=0; i < MATRIX_ROWS; i++) { 65 for (uint8_t i=0; i < MATRIX_ROWS; i++) {
70 matrix[i] = 0; 66 matrix[i] = 0;
71 matrix_debouncing[i] = 0; 67 matrix_debouncing[i] = 0;
@@ -92,9 +88,9 @@ uint8_t matrix_scan(void)
92 if (--debouncing) { 88 if (--debouncing) {
93 _delay_ms(1); 89 _delay_ms(1);
94 } else { 90 } else {
95 matrix_row_t *tmp = matrix; 91 for (uint8_t i = 0; i < MATRIX_ROWS; i++) {
96 matrix = matrix_debouncing; 92 matrix[i] = matrix_debouncing[i];
97 matrix_debouncing = tmp; 93 }
98 } 94 }
99 } 95 }
100 96