diff options
author | Nick Brassel <nick@tzarc.org> | 2022-02-09 15:50:13 +1100 |
---|---|---|
committer | GitHub <noreply@github.com> | 2022-02-09 15:50:13 +1100 |
commit | efdaa7f97205f8964c076677519d1848c5ac4b41 (patch) | |
tree | a9befb11625c69b06523de248fe8a6a312d5ca38 /quantum | |
parent | e26778ceb572f3aa6cff7cc08479663899c32a92 (diff) |
Add support for driving unselected row/col. (#16278)
Diffstat (limited to 'quantum')
-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 483d518ecc..8596c2eabd 100644 --- a/quantum/matrix.c +++ b/quantum/matrix.c @@ -82,6 +82,13 @@ static inline void setPinOutput_writeLow(pin_t pin) { } } +static inline void setPinOutput_writeHigh(pin_t pin) { + ATOMIC_BLOCK_FORCEON { + setPinOutput(pin); + writePinHigh(pin); + } +} + static inline void setPinInputHigh_atomic(pin_t pin) { ATOMIC_BLOCK_FORCEON { setPinInputHigh(pin); } } @@ -141,7 +148,11 @@ static bool select_row(uint8_t row) { static void unselect_row(uint8_t row) { pin_t pin = row_pins[row]; if (pin != NO_PIN) { +# ifdef MATRIX_UNSELECT_DRIVE_HIGH + setPinOutput_writeHigh(pin); +# else setPinInputHigh_atomic(pin); +# endif } } @@ -200,7 +211,11 @@ static bool select_col(uint8_t col) { static void unselect_col(uint8_t col) { pin_t pin = col_pins[col]; if (pin != NO_PIN) { +# ifdef MATRIX_UNSELECT_DRIVE_HIGH + setPinOutput_writeHigh(pin); +# else setPinInputHigh_atomic(pin); +# endif } } |