From: tmk Date: Sat, 8 Oct 2016 01:57:38 +0000 (+0900) Subject: core: Change matrix_init and matrix_print X-Git-Url: https://git.friedersdorff.com/?a=commitdiff_plain;h=f57d834f13f669cfcd821e6cfd307269c02b167b;p=max%2Ftmk_keyboard.git core: Change matrix_init and matrix_print --- diff --git a/tmk_core/common/matrix.c b/tmk_core/common/matrix.c index 9694bd1a..9939307a 100644 --- a/tmk_core/common/matrix.c +++ b/tmk_core/common/matrix.c @@ -33,7 +33,6 @@ uint8_t matrix_cols(void) __attribute__ ((weak)) void matrix_clear(void) { - matrix_init(); } __attribute__ ((weak)) @@ -55,23 +54,22 @@ void matrix_print(void) #elif (MATRIX_COLS <= 32) print("r/c 0123456789ABCDEF0123456789ABCDEF\n"); #endif + for (uint8_t row = 0; row < MATRIX_ROWS; row++) { - xprintf("%02X:", row); #if (MATRIX_COLS <= 8) - print_bin_reverse8(matrix_get_row(row)); + xprintf("%02X: %08b%s\n", row, bitrev(matrix_get_row(row)), #elif (MATRIX_COLS <= 16) - print_bin_reverse16(matrix_get_row(row)); + xprintf("%02X: %016b%s\n", row, bitrev16(matrix_get_row(row)), #elif (MATRIX_COLS <= 32) - print_bin_reverse32(matrix_get_row(row)); + xprintf("%02X: %032b%s\n", row, bitrev32(matrix_get_row(row)), #endif - #ifdef MATRIX_HAS_GHOST - if (matrix_has_ghost_in_row(row)) { - print(" 255) +#error "MATRIX_ROWS must not exceed 255" +#endif + #define MATRIX_IS_ON(row, col) (matrix_get_row(row) && (1<