diff options
Diffstat (limited to 'quantum/split_common')
| -rw-r--r-- | quantum/split_common/matrix.c | 19 |
1 files changed, 17 insertions, 2 deletions
diff --git a/quantum/split_common/matrix.c b/quantum/split_common/matrix.c index 4af90209f..3d2983f2e 100644 --- a/quantum/split_common/matrix.c +++ b/quantum/split_common/matrix.c | |||
| @@ -71,8 +71,8 @@ static matrix_row_t matrix_debouncing[MATRIX_ROWS]; | |||
| 71 | 71 | ||
| 72 | static uint8_t error_count = 0; | 72 | static uint8_t error_count = 0; |
| 73 | 73 | ||
| 74 | static const uint8_t row_pins[MATRIX_ROWS] = MATRIX_ROW_PINS; | 74 | static uint8_t row_pins[MATRIX_ROWS] = MATRIX_ROW_PINS; |
| 75 | static const uint8_t col_pins[MATRIX_COLS] = MATRIX_COL_PINS; | 75 | static uint8_t col_pins[MATRIX_COLS] = MATRIX_COL_PINS; |
| 76 | 76 | ||
| 77 | /* matrix state(1:on, 0:off) */ | 77 | /* matrix state(1:on, 0:off) */ |
| 78 | static matrix_row_t matrix[MATRIX_ROWS]; | 78 | static matrix_row_t matrix[MATRIX_ROWS]; |
| @@ -137,6 +137,21 @@ void matrix_init(void) | |||
| 137 | debug_enable = true; | 137 | debug_enable = true; |
| 138 | debug_matrix = true; | 138 | debug_matrix = true; |
| 139 | debug_mouse = true; | 139 | debug_mouse = true; |
| 140 | |||
| 141 | // Set pinout for right half if pinout for that half is defined | ||
| 142 | if (!isLeftHand) { | ||
| 143 | #ifdef MATRIX_ROW_PINS_RIGHT | ||
| 144 | const uint8_t row_pins_right[MATRIX_ROWS] = MATRIX_ROW_PINS_RIGHT; | ||
| 145 | for (uint8_t i = 0; i < MATRIX_ROWS; i++) | ||
| 146 | row_pins[i] = row_pins_right[i]; | ||
| 147 | #endif | ||
| 148 | #ifdef MATRIX_COL_PINS_RIGHT | ||
| 149 | const uint8_t col_pins_right[MATRIX_COLS] = MATRIX_COL_PINS_RIGHT; | ||
| 150 | for (uint8_t i = 0; i < MATRIX_COLS; i++) | ||
| 151 | col_pins[i] = col_pins_right[i]; | ||
| 152 | #endif | ||
| 153 | } | ||
| 154 | |||
| 140 | // initialize row and col | 155 | // initialize row and col |
| 141 | #if (DIODE_DIRECTION == COL2ROW) | 156 | #if (DIODE_DIRECTION == COL2ROW) |
| 142 | unselect_rows(); | 157 | unselect_rows(); |
