aboutsummaryrefslogtreecommitdiff
path: root/keyboards/handwired/xealousbrown/matrix.c
diff options
context:
space:
mode:
Diffstat (limited to 'keyboards/handwired/xealousbrown/matrix.c')
-rw-r--r--keyboards/handwired/xealousbrown/matrix.c10
1 files changed, 7 insertions, 3 deletions
diff --git a/keyboards/handwired/xealousbrown/matrix.c b/keyboards/handwired/xealousbrown/matrix.c
index cce0d06eb..ba86ab7af 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
28 28
29// matrix code 29// matrix code
30// super fast read_cols code. 30// super fast read_cols code.
31static matrix_row_t read_cols(void) { 31static inline matrix_row_t read_cols(void) {
32 return (PINC & (1 << 6) ? 0 : (1UL << 0)) | 32 return (PINC & (1 << 6) ? 0 : (1UL << 0)) |
33 (PIND & (1 << 7) ? 0 : (1UL << 1)) | 33 (PIND & (1 << 7) ? 0 : (1UL << 1)) |
34 (PINE & (1 << 6) ? 0 : (1UL << 2)) | 34 (PINE & (1 << 6) ? 0 : (1UL << 2)) |
@@ -100,13 +100,17 @@ uint8_t matrix_scan_custom(matrix_row_t current_matrix[]) {
100 // Set row, read cols 100 // Set row, read cols
101 for (uint8_t current_row = 0; current_row < MATRIX_ROWS; current_row++) { 101 for (uint8_t current_row = 0; current_row < MATRIX_ROWS; current_row++) {
102 select_row(current_row); 102 select_row(current_row);
103 asm volatile("nop"); 103 matrix_output_select_delay();
104 asm volatile("nop"); 104
105 matrix_row_t cols = read_cols(); 105 matrix_row_t cols = read_cols();
106 changed |= (current_matrix[current_row] != cols); 106 changed |= (current_matrix[current_row] != cols);
107 current_matrix[current_row] = cols; 107 current_matrix[current_row] = cols;
108
108 unselect_rows(); 109 unselect_rows();
110 //this internally calls matrix_io_delay()
111 matrix_output_unselect_delay();
109 } 112 }
110 113
111 return changed; 114 return changed;
112} 115}
116