void matrix_print(void) { #if (MATRIX_COLS <= 8) print("r/c 01234567\n"); #elif (MATRIX_COLS <= 16) print("r/c 0123456789ABCDEF\n"); #elif (MATRIX_COLS <= 32) print("r/c 0123456789ABCDEF0123456789ABCDEF\n"); #endif for (uint8_t row = 0; row < MATRIX_ROWS; row++) { #if (MATRIX_COLS <= 8) xprintf("%02X: %08b%s\n", row, bitrev(matrix_get_row(row)), #elif (MATRIX_COLS <= 16) xprintf("%02X: %016b%s\n", row, bitrev16(matrix_get_row(row)), #elif (MATRIX_COLS <= 32) xprintf("%02X: %032b%s\n", row, bitrev32(matrix_get_row(row)), #endif #ifdef MATRIX_HAS_GHOST matrix_has_ghost_in_row(row) ? " <ghost" : "" #else "" #endif ); } }
inline bool matrix_has_ghost(void) { #ifdef MATRIX_HAS_GHOST for (uint8_t i = 0; i < MATRIX_ROWS; i++) { if (matrix_has_ghost_in_row(i)) return true; } #endif return false; }
void matrix_print(void) { print("\nr/c 01234567\n"); for (uint8_t row = 0; row < matrix_rows(); row++) { phex(row); print(": "); pbin_reverse(matrix_get_row(row)); #ifdef MATRIX_HAS_GHOST if (matrix_has_ghost_in_row(row)) { print(" <ghost"); } #endif print("\n"); } }
void matrix_print(void) { #if (MATRIX_COLS <= 8) print("\nr/c 01234567\n"); #else print("\nr/c 0123456789ABCDEF\n"); #endif for (uint8_t row = 0; row < matrix_rows(); row++) { phex(row); print(": "); #if (MATRIX_COLS <= 8) pbin_reverse(matrix_get_row(row)); #else pbin_reverse16(matrix_get_row(row)); #endif #ifdef MATRIX_HAS_GHOST if (matrix_has_ghost_in_row(row)) { print(" <ghost"); } #endif print("\n"); } }