diff options
| author | Nick Brassel <nick@tzarc.org> | 2022-02-09 16:00:09 +1100 |
|---|---|---|
| committer | Nick Brassel <nick@tzarc.org> | 2022-02-09 16:00:09 +1100 |
| commit | a2ffdb4abdbaf7de5206a1114394fbd6fd0b3a19 (patch) | |
| tree | 80d8c4bcb53ad7d08792d622ca0f65de5cc616a4 /quantum/matrix.c | |
| parent | 74e8a71768c5b6ce04e45b4418784c70d6ca3386 (diff) | |
| parent | efdaa7f97205f8964c076677519d1848c5ac4b41 (diff) | |
Merge remote-tracking branch 'upstream/master' into develop
Diffstat (limited to 'quantum/matrix.c')
| -rw-r--r-- | quantum/matrix.c | 15 |
1 files changed, 15 insertions, 0 deletions
diff --git a/quantum/matrix.c b/quantum/matrix.c index 1dd9655e57..244c4d08b0 100644 --- a/quantum/matrix.c +++ b/quantum/matrix.c | |||
| @@ -78,6 +78,13 @@ static inline void setPinOutput_writeLow(pin_t pin) { | |||
| 78 | } | 78 | } |
| 79 | } | 79 | } |
| 80 | 80 | ||
| 81 | static inline void setPinOutput_writeHigh(pin_t pin) { | ||
| 82 | ATOMIC_BLOCK_FORCEON { | ||
| 83 | setPinOutput(pin); | ||
| 84 | writePinHigh(pin); | ||
| 85 | } | ||
| 86 | } | ||
| 87 | |||
| 81 | static inline void setPinInputHigh_atomic(pin_t pin) { | 88 | static inline void setPinInputHigh_atomic(pin_t pin) { |
| 82 | ATOMIC_BLOCK_FORCEON { setPinInputHigh(pin); } | 89 | ATOMIC_BLOCK_FORCEON { setPinInputHigh(pin); } |
| 83 | } | 90 | } |
| @@ -137,7 +144,11 @@ static bool select_row(uint8_t row) { | |||
| 137 | static void unselect_row(uint8_t row) { | 144 | static void unselect_row(uint8_t row) { |
| 138 | pin_t pin = row_pins[row]; | 145 | pin_t pin = row_pins[row]; |
| 139 | if (pin != NO_PIN) { | 146 | if (pin != NO_PIN) { |
| 147 | # ifdef MATRIX_UNSELECT_DRIVE_HIGH | ||
| 148 | setPinOutput_writeHigh(pin); | ||
| 149 | # else | ||
| 140 | setPinInputHigh_atomic(pin); | 150 | setPinInputHigh_atomic(pin); |
| 151 | # endif | ||
| 141 | } | 152 | } |
| 142 | } | 153 | } |
| 143 | 154 | ||
| @@ -196,7 +207,11 @@ static bool select_col(uint8_t col) { | |||
| 196 | static void unselect_col(uint8_t col) { | 207 | static void unselect_col(uint8_t col) { |
| 197 | pin_t pin = col_pins[col]; | 208 | pin_t pin = col_pins[col]; |
| 198 | if (pin != NO_PIN) { | 209 | if (pin != NO_PIN) { |
| 210 | # ifdef MATRIX_UNSELECT_DRIVE_HIGH | ||
| 211 | setPinOutput_writeHigh(pin); | ||
| 212 | # else | ||
| 199 | setPinInputHigh_atomic(pin); | 213 | setPinInputHigh_atomic(pin); |
| 214 | # endif | ||
| 200 | } | 215 | } |
| 201 | } | 216 | } |
| 202 | 217 | ||
