diff options
author | Nick Brassel <nick@tzarc.org> | 2021-01-15 06:55:07 +1100 |
---|---|---|
committer | Nick Brassel <nick@tzarc.org> | 2021-01-15 06:55:07 +1100 |
commit | ab375d3d075c105f09a1ddd0e155f178225518bc (patch) | |
tree | 89e5ba3ddf9e3bba49759a0ea9cad9565f1ad5d1 /quantum | |
parent | 4b4445290038d19e2f0b31c293f39628dd77cb12 (diff) |
Revert "Keep track of last matrix activity (#10730)"
This reverts commit 79d1db332477963555416d9fff82ecac4399bd52.
Diffstat (limited to 'quantum')
-rw-r--r-- | quantum/split_common/matrix.c | 29 |
1 files changed, 9 insertions, 20 deletions
diff --git a/quantum/split_common/matrix.c b/quantum/split_common/matrix.c index 067815c991..22ff89bfc6 100644 --- a/quantum/split_common/matrix.c +++ b/quantum/split_common/matrix.c @@ -251,59 +251,48 @@ void matrix_init(void) { split_post_init(); } -bool matrix_post_scan(void) { - bool changed = false; +void matrix_post_scan(void) { if (is_keyboard_master()) { static uint8_t error_count; - matrix_row_t slave_matrix[ROWS_PER_HAND] = {0}; - if (!transport_master(slave_matrix)) { + if (!transport_master(matrix + thatHand)) { error_count++; if (error_count > ERROR_DISCONNECT_COUNT) { // reset other half if disconnected for (int i = 0; i < ROWS_PER_HAND; ++i) { - slave_matrix[i] = 0; + matrix[thatHand + i] = 0; } } } else { error_count = 0; } - for (int i = 0; i < ROWS_PER_HAND; ++i) { - if (matrix[thatHand + i] != slave_matrix[i]) { - matrix[thatHand + i] = slave_matrix[i]; - changed = true; - } - } - matrix_scan_quantum(); } else { transport_slave(matrix + thisHand); matrix_slave_scan_user(); } - - return changed; } uint8_t matrix_scan(void) { - bool local_changed = false; + bool changed = false; #if defined(DIRECT_PINS) || (DIODE_DIRECTION == COL2ROW) // Set row, read cols for (uint8_t current_row = 0; current_row < ROWS_PER_HAND; current_row++) { - local_changed |= read_cols_on_row(raw_matrix, current_row); + changed |= read_cols_on_row(raw_matrix, current_row); } #elif (DIODE_DIRECTION == ROW2COL) // Set col, read rows for (uint8_t current_col = 0; current_col < MATRIX_COLS; current_col++) { - local_changed |= read_rows_on_col(raw_matrix, current_col); + changed |= read_rows_on_col(raw_matrix, current_col); } #endif - debounce(raw_matrix, matrix + thisHand, ROWS_PER_HAND, local_changed); + debounce(raw_matrix, matrix + thisHand, ROWS_PER_HAND, changed); - bool remote_changed = matrix_post_scan(); - return (uint8_t)(local_changed || remote_changed); + matrix_post_scan(); + return (uint8_t)changed; } |