From 8a9688bc64ea4283ecfa19dc2bf2c3312e7c646f Mon Sep 17 00:00:00 2001 From: Alex Ong Date: Sat, 7 Aug 2021 16:51:38 +1000 Subject: [Keyboard] Use new matrix_output_select_delay api (#13861) * Use new matrix_output_select_delay api * Updated delay to 15 after more spamming --- keyboards/handwired/xealousbrown/matrix.c | 10 +++++++--- 1 file changed, 7 insertions(+), 3 deletions(-) (limited to 'keyboards/handwired/xealousbrown/matrix.c') diff --git a/keyboards/handwired/xealousbrown/matrix.c b/keyboards/handwired/xealousbrown/matrix.c index cce0d06ebb..ba86ab7af0 100644 --- a/keyboards/handwired/xealousbrown/matrix.c +++ b/keyboards/handwired/xealousbrown/matrix.c @@ -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; } + -- cgit v1.2.3