~ruther/qmk_firmware

6caefe9649d88673719e969502d220c5e9dcd124 — tmk 12 years ago 613fdb2
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.
3 files changed, 7 insertions(+), 6 deletions(-)

M common/command.c
M common/keyboard.c
M common/print.c
M common/command.c => common/command.c +1 -0
@@ 234,6 234,7 @@ static bool command_common(uint8_t code)
            break;
#ifdef NKRO_ENABLE
        case KC_N:
            clear_keyboard(); //Prevents stuck keys.
            keyboard_nkro = !keyboard_nkro;
            if (keyboard_nkro)
                print("NKRO: enabled\n");

M common/keyboard.c => common/keyboard.c +5 -5
@@ 564,20 564,20 @@ void keyboard_task(void)
    matrix_row_t matrix_change = 0;

    matrix_scan();
    for (int r = 0; r < MATRIX_ROWS; r++) {
    for (uint8_t r = 0; r < MATRIX_ROWS; r++) {
        matrix_row = matrix_get_row(r);
        matrix_change = matrix_row ^ matrix_prev[r];
        if (matrix_change) {
            if (debug_matrix) matrix_print();

            for (int c = 0; c < MATRIX_COLS; c++) {
                if (matrix_change & (1<<c)) {
            for (uint8_t c = 0; c < MATRIX_COLS; c++) {
                if (matrix_change & ((matrix_row_t)1<<c)) {
                    process_key((keyevent_t){
                        .key = (key_t){ .row = r, .col = c },
                        .pressed = (matrix_row & (1<<c))
                        .pressed = (matrix_row & ((matrix_row_t)1<<c))
                    });
                    // record a processed key
                    matrix_prev[r] ^= (1<<c);
                    matrix_prev[r] ^= ((matrix_row_t)1<<c);
                    // process a key per task call
                    goto MATRIX_LOOP_END;
                }

M common/print.c => common/print.c +1 -1
@@ 138,7 138,7 @@ void print_hex32(uint32_t data)
}


void print_bin(uint8_t data)
void print_bin8(uint8_t data)
{
    for (int i = 7; i >= 0; i--) {
        sendchar((data & (1<<i)) ? '1' : '0');