diff options
author | tmk <nobody@nowhere> | 2012-12-05 14:35:46 +0900 |
---|---|---|
committer | tmk <nobody@nowhere> | 2012-12-05 14:35:46 +0900 |
commit | e70e4a3a67a4c6befc311f66f672ad22fb76c737 (patch) | |
tree | 6d647b06425997cd8acf07eaf7151fdbb4094348 /keyboard/hid_liber/matrix.c | |
parent | b6e07aa85d799c0254e9c010aa210c019506ff7b (diff) |
Fix debouncing and ISO layout from 4LI4Z and alaricljs.(hid_liber)
Diffstat (limited to 'keyboard/hid_liber/matrix.c')
-rw-r--r-- | keyboard/hid_liber/matrix.c | 7 |
1 files changed, 4 insertions, 3 deletions
diff --git a/keyboard/hid_liber/matrix.c b/keyboard/hid_liber/matrix.c index 6798b36d7e..2d939ef63b 100644 --- a/keyboard/hid_liber/matrix.c +++ b/keyboard/hid_liber/matrix.c @@ -19,7 +19,7 @@ #ifndef DEBOUNCE -# define DEBOUNCE 0 +# define DEBOUNCE 0 #endif static uint8_t debouncing = DEBOUNCE; @@ -142,7 +142,7 @@ void matrix_init(void) // To use PORTF disable JTAG with writing JTD bit twice within four cycles. MCUCR |= (1<<JTD); MCUCR |= (1<<JTD); - + // initialize row and col setup_io_pins(); setup_leds(); @@ -164,7 +164,7 @@ uint8_t matrix_scan(void) for (uint8_t col = 0; col < MATRIX_COLS; col++) { // 0-7 pull_column(col); // output hi on theline - _delay_us(3); // without this wait it won't read stable value. + _delay_us(5); // without this wait it won't read stable value. for (uint8_t row = 0; row < MATRIX_ROWS; row++) { // 0-17 bool prev_bit = matrix[row] & (1<<col); bool curr_bit = *row_pin[row] & row_bit[row]; @@ -173,6 +173,7 @@ uint8_t matrix_scan(void) if (debouncing) { debug("bounce!: "); debug_hex(debouncing); print("\n"); } + _delay_ms(1); // improved affect on bouncing debouncing = DEBOUNCE; } } |