aboutsummaryrefslogtreecommitdiff
path: root/quantum/split_common
diff options
context:
space:
mode:
Diffstat (limited to 'quantum/split_common')
-rw-r--r--quantum/split_common/matrix.c18
1 files changed, 9 insertions, 9 deletions
diff --git a/quantum/split_common/matrix.c b/quantum/split_common/matrix.c
index 039e7d977..a54ea90b3 100644
--- a/quantum/split_common/matrix.c
+++ b/quantum/split_common/matrix.c
@@ -61,7 +61,7 @@ static inline void setPinInputHigh_atomic(pin_t pin) {
61 61
62#ifdef DIRECT_PINS 62#ifdef DIRECT_PINS
63 63
64static void init_pins(void) { 64__attribute__((weak)) void matrix_init_pins(void) {
65 for (int row = 0; row < MATRIX_ROWS; row++) { 65 for (int row = 0; row < MATRIX_ROWS; row++) {
66 for (int col = 0; col < MATRIX_COLS; col++) { 66 for (int col = 0; col < MATRIX_COLS; col++) {
67 pin_t pin = direct_pins[row][col]; 67 pin_t pin = direct_pins[row][col];
@@ -72,7 +72,7 @@ static void init_pins(void) {
72 } 72 }
73} 73}
74 74
75static bool read_cols_on_row(matrix_row_t current_matrix[], uint8_t current_row) { 75__attribute__((weak)) bool matrix_read_cols_on_row(matrix_row_t current_matrix[], uint8_t current_row) {
76 // Start with a clear matrix row 76 // Start with a clear matrix row
77 matrix_row_t current_row_value = 0; 77 matrix_row_t current_row_value = 0;
78 78
@@ -104,14 +104,14 @@ static void unselect_rows(void) {
104 } 104 }
105} 105}
106 106
107static void init_pins(void) { 107__attribute__((weak)) void matrix_init_pins(void) {
108 unselect_rows(); 108 unselect_rows();
109 for (uint8_t x = 0; x < MATRIX_COLS; x++) { 109 for (uint8_t x = 0; x < MATRIX_COLS; x++) {
110 setPinInputHigh_atomic(col_pins[x]); 110 setPinInputHigh_atomic(col_pins[x]);
111 } 111 }
112} 112}
113 113
114static bool read_cols_on_row(matrix_row_t current_matrix[], uint8_t current_row) { 114__attribute__((weak)) bool matrix_read_cols_on_row(matrix_row_t current_matrix[], uint8_t current_row) {
115 // Start with a clear matrix row 115 // Start with a clear matrix row
116 matrix_row_t current_row_value = 0; 116 matrix_row_t current_row_value = 0;
117 117
@@ -152,14 +152,14 @@ static void unselect_cols(void) {
152 } 152 }
153} 153}
154 154
155static void init_pins(void) { 155__attribute__((weak)) void matrix_init_pins(void) {
156 unselect_cols(); 156 unselect_cols();
157 for (uint8_t x = 0; x < ROWS_PER_HAND; x++) { 157 for (uint8_t x = 0; x < ROWS_PER_HAND; x++) {
158 setPinInputHigh_atomic(row_pins[x]); 158 setPinInputHigh_atomic(row_pins[x]);
159 } 159 }
160} 160}
161 161
162static bool read_rows_on_col(matrix_row_t current_matrix[], uint8_t current_col) { 162__attribute__((weak)) bool matrix_read_rows_on_col(matrix_row_t current_matrix[], uint8_t current_col) {
163 bool matrix_changed = false; 163 bool matrix_changed = false;
164 164
165 // Select col 165 // Select col
@@ -233,7 +233,7 @@ void matrix_init(void) {
233 thatHand = ROWS_PER_HAND - thisHand; 233 thatHand = ROWS_PER_HAND - thisHand;
234 234
235 // initialize key pins 235 // initialize key pins
236 init_pins(); 236 matrix_init_pins();
237 237
238 // initialize matrix state: all keys off 238 // initialize matrix state: all keys off
239 for (uint8_t i = 0; i < MATRIX_ROWS; i++) { 239 for (uint8_t i = 0; i < MATRIX_ROWS; i++) {
@@ -293,12 +293,12 @@ uint8_t matrix_scan(void) {
293#if defined(DIRECT_PINS) || (DIODE_DIRECTION == COL2ROW) 293#if defined(DIRECT_PINS) || (DIODE_DIRECTION == COL2ROW)
294 // Set row, read cols 294 // Set row, read cols
295 for (uint8_t current_row = 0; current_row < ROWS_PER_HAND; current_row++) { 295 for (uint8_t current_row = 0; current_row < ROWS_PER_HAND; current_row++) {
296 local_changed |= read_cols_on_row(raw_matrix, current_row); 296 local_changed |= matrix_read_cols_on_row(raw_matrix, current_row);
297 } 297 }
298#elif (DIODE_DIRECTION == ROW2COL) 298#elif (DIODE_DIRECTION == ROW2COL)
299 // Set col, read rows 299 // Set col, read rows
300 for (uint8_t current_col = 0; current_col < MATRIX_COLS; current_col++) { 300 for (uint8_t current_col = 0; current_col < MATRIX_COLS; current_col++) {
301 local_changed |= read_rows_on_col(raw_matrix, current_col); 301 local_changed |= matrix_read_rows_on_col(raw_matrix, current_col);
302 } 302 }
303#endif 303#endif
304 304