1
0
Fork 0

Call remote matrix update, when the matrix changes

This commit is contained in:
Fred Sundvik 2016-02-28 23:58:47 +02:00
parent 6fe6d111bf
commit 168c5b679f
1 changed files with 3 additions and 11 deletions

View File

@ -137,6 +137,8 @@ void init_serial_link(void) {
LOWPRIO, serialThread, NULL); LOWPRIO, serialThread, NULL);
} }
void matrix_set_remote(matrix_row_t* rows, uint8_t index);
void serial_link_update(void) { void serial_link_update(void) {
systime_t current_time = chVTGetSystemTimeX(); systime_t current_time = chVTGetSystemTimeX();
if (current_time - last_update > 1000) { if (current_time - last_update > 1000) {
@ -166,17 +168,7 @@ void serial_link_update(void) {
matrix_object_t* m = read_keyboard_matrix(0); matrix_object_t* m = read_keyboard_matrix(0);
if (m) { if (m) {
xprintf("\nr/c 01234567\n"); matrix_set_remote(m->rows, 0);
for (uint8_t row = 0; row < MATRIX_ROWS; row++) {
xprintf("%X0: ", row);
for (int col = 0; col < MATRIX_COLS; col++) {
if (m->rows[row] & (1<<col))
xprintf("1");
else
xprintf("0");
}
xprintf("\n");
}
} }
} }