1
0
Fork 0

[Keyboard] Use new matrix_output_select_delay api (#13861)

* Use new matrix_output_select_delay api

* Updated delay to 15 after more spamming
This commit is contained in:
Alex Ong 2021-08-07 16:51:38 +10:00 committed by GitHub
parent 9d88786b6f
commit 8a9688bc64
No known key found for this signature in database
GPG key ID: 4AEE18F83AFDEB23
5 changed files with 20 additions and 10 deletions

View file

@ -28,7 +28,7 @@ extern matrix_row_t matrix[MATRIX_ROWS]; // debounced values
// matrix code
// super fast read_cols code.
static matrix_row_t read_cols(void) {
static inline matrix_row_t read_cols(void) {
return (PINC & (1 << 6) ? 0 : (1UL << 0)) |
(PIND & (1 << 7) ? 0 : (1UL << 1)) |
(PINE & (1 << 6) ? 0 : (1UL << 2)) |
@ -100,13 +100,17 @@ uint8_t matrix_scan_custom(matrix_row_t current_matrix[]) {
// Set row, read cols
for (uint8_t current_row = 0; current_row < MATRIX_ROWS; current_row++) {
select_row(current_row);
asm volatile("nop");
asm volatile("nop");
matrix_output_select_delay();
matrix_row_t cols = read_cols();
changed |= (current_matrix[current_row] != cols);
current_matrix[current_row] = cols;
unselect_rows();
//this internally calls matrix_io_delay()
matrix_output_unselect_delay();
}
return changed;
}