1
0
Fork 0

start to define keymap; annoying because rows and columns are swapped from schematic

This commit is contained in:
Gabriel Young 2017-03-19 19:55:55 -07:00
parent d7fc236540
commit 4a97ef6c48
3 changed files with 84 additions and 5 deletions

View file

@ -151,11 +151,13 @@ inline matrix_row_t matrix_get_row(uint8_t row) {
return matrix[row];
}
static const char ROW_NAMES[] = "ABCDEFGHIJKLMNOPQR";
void matrix_print(void) {
print("\nr/c 01234567\n");
for (uint8_t row = 0; row < MATRIX_ROWS; row++) {
matrix_row_t row_scan = matrix_get_row(row);
xprintf("%02X: ", row);
xprintf("%c: ", ROW_NAMES[row]);
for (uint8_t col = 0; col < MATRIX_COLS; col++) {
bool curr_bit = row_scan & (1<<col);
xprintf("%c", curr_bit ? '*' : '.');