summaryrefslogtreecommitdiffstats
path: root/quantum
diff options
context:
space:
mode:
Diffstat (limited to 'quantum')
-rw-r--r--quantum/matrix.c15
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) {
}
}
+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); }
}
@@ -137,7 +144,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
}
}
@@ -196,7 +207,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
}
}