diff options
| author | tmk <nobody@nowhere> | 2012-10-17 14:23:31 +0900 |
|---|---|---|
| committer | tmk <nobody@nowhere> | 2012-10-17 15:55:37 +0900 |
| commit | bc5ee91d14547124fd138c09b0c3623e4eefe757 (patch) | |
| tree | a0bca2effdb4c6e8eb2fdceb624378ae96dca5f0 /keyboard/hhkb/matrix.c | |
| parent | 30eb3e3520e9d4d7b9a9dbac0c5c0200485103c2 (diff) | |
| download | qmk_firmware-bc5ee91d14547124fd138c09b0c3623e4eefe757.tar.gz qmk_firmware-bc5ee91d14547124fd138c09b0c3623e4eefe757.zip | |
HHKB scan matrix: fix wait time on power on
Diffstat (limited to 'keyboard/hhkb/matrix.c')
| -rw-r--r-- | keyboard/hhkb/matrix.c | 21 |
1 files changed, 12 insertions, 9 deletions
diff --git a/keyboard/hhkb/matrix.c b/keyboard/hhkb/matrix.c index 3bd6e73b3..01473d1ec 100644 --- a/keyboard/hhkb/matrix.c +++ b/keyboard/hhkb/matrix.c | |||
| @@ -23,7 +23,7 @@ along with this program. If not, see <http://www.gnu.org/licenses/>. | |||
| 23 | #include <avr/io.h> | 23 | #include <avr/io.h> |
| 24 | #include <avr/interrupt.h> | 24 | #include <avr/interrupt.h> |
| 25 | #include <util/delay.h> | 25 | #include <util/delay.h> |
| 26 | #include "print.h" | 26 | #include "debug.h" |
| 27 | #include "util.h" | 27 | #include "util.h" |
| 28 | #include "timer.h" | 28 | #include "timer.h" |
| 29 | #include "matrix.h" | 29 | #include "matrix.h" |
| @@ -107,7 +107,7 @@ static matrix_row_t _matrix1[MATRIX_ROWS]; | |||
| 107 | #define KEY_POWER_ON() do { \ | 107 | #define KEY_POWER_ON() do { \ |
| 108 | KEY_INIT(); \ | 108 | KEY_INIT(); \ |
| 109 | PORTB &= ~(1<<5); \ | 109 | PORTB &= ~(1<<5); \ |
| 110 | _delay_us(200); \ | 110 | _delay_ms(1); \ |
| 111 | } while (0) | 111 | } while (0) |
| 112 | #define KEY_POWER_OFF() do { \ | 112 | #define KEY_POWER_OFF() do { \ |
| 113 | DDRB &= ~0x3F; \ | 113 | DDRB &= ~0x3F; \ |
| @@ -228,21 +228,24 @@ uint16_t matrix_get_row(uint8_t row) | |||
| 228 | return matrix[row]; | 228 | return matrix[row]; |
| 229 | } | 229 | } |
| 230 | 230 | ||
| 231 | void matrix_print(void) | 231 | void matrix_debug(void) |
| 232 | { | 232 | { |
| 233 | if (!debug_matrix) | ||
| 234 | return; | ||
| 235 | |||
| 233 | #if (MATRIX_COLS <= 8) | 236 | #if (MATRIX_COLS <= 8) |
| 234 | print("\nr/c 01234567\n"); | 237 | debug("\nr/c 01234567\n"); |
| 235 | #else | 238 | #else |
| 236 | print("\nr/c 0123456789ABCDEF\n"); | 239 | debug("\nr/c 0123456789ABCDEF\n"); |
| 237 | #endif | 240 | #endif |
| 238 | for (uint8_t row = 0; row < matrix_rows(); row++) { | 241 | for (uint8_t row = 0; row < matrix_rows(); row++) { |
| 239 | phex(row); print(": "); | 242 | debug_hex(row); debug(": "); |
| 240 | #if (MATRIX_COLS <= 8) | 243 | #if (MATRIX_COLS <= 8) |
| 241 | pbin_reverse(matrix_get_row(row)); | 244 | debug_bin_reverse(matrix_get_row(row)); |
| 242 | #else | 245 | #else |
| 243 | pbin_reverse16(matrix_get_row(row)); | 246 | debug_bin_reverse16(matrix_get_row(row)); |
| 244 | #endif | 247 | #endif |
| 245 | print("\n"); | 248 | debug("\n"); |
| 246 | } | 249 | } |
| 247 | } | 250 | } |
| 248 | 251 | ||
