diff options
| author | tmk <nobody@nowhere> | 2012-11-23 12:33:42 +0900 |
|---|---|---|
| committer | tmk <nobody@nowhere> | 2012-11-23 12:33:42 +0900 |
| commit | 6caefe9649d88673719e969502d220c5e9dcd124 (patch) | |
| tree | 332455746dd60b60d18f5eec39487f96192fe330 | |
| parent | 613fdb24fcdb4f8920f0d344cad5800d343f535c (diff) | |
| download | qmk_firmware-6caefe9649d88673719e969502d220c5e9dcd124.tar.gz qmk_firmware-6caefe9649d88673719e969502d220c5e9dcd124.zip | |
Fixes from Tranquilite@GH.
- Fix keyboard_task() when matrix column size > 16
- Add clear_keyboard() in NKRO command to avoid stucking keys.
- Fix function name in print.c.
| -rw-r--r-- | common/command.c | 1 | ||||
| -rw-r--r-- | common/keyboard.c | 10 | ||||
| -rw-r--r-- | common/print.c | 2 |
3 files changed, 7 insertions, 6 deletions
diff --git a/common/command.c b/common/command.c index a06e6a00d..5cdd168d4 100644 --- a/common/command.c +++ b/common/command.c | |||
| @@ -234,6 +234,7 @@ static bool command_common(uint8_t code) | |||
| 234 | break; | 234 | break; |
| 235 | #ifdef NKRO_ENABLE | 235 | #ifdef NKRO_ENABLE |
| 236 | case KC_N: | 236 | case KC_N: |
| 237 | clear_keyboard(); //Prevents stuck keys. | ||
| 237 | keyboard_nkro = !keyboard_nkro; | 238 | keyboard_nkro = !keyboard_nkro; |
| 238 | if (keyboard_nkro) | 239 | if (keyboard_nkro) |
| 239 | print("NKRO: enabled\n"); | 240 | print("NKRO: enabled\n"); |
diff --git a/common/keyboard.c b/common/keyboard.c index fa22116f1..cd1ceb420 100644 --- a/common/keyboard.c +++ b/common/keyboard.c | |||
| @@ -564,20 +564,20 @@ void keyboard_task(void) | |||
| 564 | matrix_row_t matrix_change = 0; | 564 | matrix_row_t matrix_change = 0; |
| 565 | 565 | ||
| 566 | matrix_scan(); | 566 | matrix_scan(); |
| 567 | for (int r = 0; r < MATRIX_ROWS; r++) { | 567 | for (uint8_t r = 0; r < MATRIX_ROWS; r++) { |
| 568 | matrix_row = matrix_get_row(r); | 568 | matrix_row = matrix_get_row(r); |
| 569 | matrix_change = matrix_row ^ matrix_prev[r]; | 569 | matrix_change = matrix_row ^ matrix_prev[r]; |
| 570 | if (matrix_change) { | 570 | if (matrix_change) { |
| 571 | if (debug_matrix) matrix_print(); | 571 | if (debug_matrix) matrix_print(); |
| 572 | 572 | ||
| 573 | for (int c = 0; c < MATRIX_COLS; c++) { | 573 | for (uint8_t c = 0; c < MATRIX_COLS; c++) { |
| 574 | if (matrix_change & (1<<c)) { | 574 | if (matrix_change & ((matrix_row_t)1<<c)) { |
| 575 | process_key((keyevent_t){ | 575 | process_key((keyevent_t){ |
| 576 | .key = (key_t){ .row = r, .col = c }, | 576 | .key = (key_t){ .row = r, .col = c }, |
| 577 | .pressed = (matrix_row & (1<<c)) | 577 | .pressed = (matrix_row & ((matrix_row_t)1<<c)) |
| 578 | }); | 578 | }); |
| 579 | // record a processed key | 579 | // record a processed key |
| 580 | matrix_prev[r] ^= (1<<c); | 580 | matrix_prev[r] ^= ((matrix_row_t)1<<c); |
| 581 | // process a key per task call | 581 | // process a key per task call |
| 582 | goto MATRIX_LOOP_END; | 582 | goto MATRIX_LOOP_END; |
| 583 | } | 583 | } |
diff --git a/common/print.c b/common/print.c index d8a899b40..84400a1df 100644 --- a/common/print.c +++ b/common/print.c | |||
| @@ -138,7 +138,7 @@ void print_hex32(uint32_t data) | |||
| 138 | } | 138 | } |
| 139 | 139 | ||
| 140 | 140 | ||
| 141 | void print_bin(uint8_t data) | 141 | void print_bin8(uint8_t data) |
| 142 | { | 142 | { |
| 143 | for (int i = 7; i >= 0; i--) { | 143 | for (int i = 7; i >= 0; i--) { |
| 144 | sendchar((data & (1<<i)) ? '1' : '0'); | 144 | sendchar((data & (1<<i)) ? '1' : '0'); |
