mirror of
https://github.com/Keychron/qmk_firmware.git
synced 2024-12-25 18:48:05 +06:00
Update matrix.c
This commit is contained in:
parent
5a3614f843
commit
dfa898807d
@ -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) {
|
static inline void setPinInputHigh_atomic(pin_t pin) {
|
||||||
ATOMIC_BLOCK_FORCEON { setPinInputHigh(pin); }
|
ATOMIC_BLOCK_FORCEON { setPinInputHigh(pin); }
|
||||||
}
|
}
|
||||||
@ -141,7 +148,11 @@ static bool select_row(uint8_t row) {
|
|||||||
static void unselect_row(uint8_t row) {
|
static void unselect_row(uint8_t row) {
|
||||||
pin_t pin = row_pins[row];
|
pin_t pin = row_pins[row];
|
||||||
if (pin != NO_PIN) {
|
if (pin != NO_PIN) {
|
||||||
|
# ifdef MATRIX_UNSELECT_DRIVE_HIGH
|
||||||
|
setPinOutput_writeHigh(pin);
|
||||||
|
# else
|
||||||
setPinInputHigh_atomic(pin);
|
setPinInputHigh_atomic(pin);
|
||||||
|
# endif
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
@ -200,7 +211,11 @@ static bool select_col(uint8_t col) {
|
|||||||
static void unselect_col(uint8_t col) {
|
static void unselect_col(uint8_t col) {
|
||||||
pin_t pin = col_pins[col];
|
pin_t pin = col_pins[col];
|
||||||
if (pin != NO_PIN) {
|
if (pin != NO_PIN) {
|
||||||
|
# ifdef MATRIX_UNSELECT_DRIVE_HIGH
|
||||||
|
setPinOutput_writeHigh(pin);
|
||||||
|
# else
|
||||||
setPinInputHigh_atomic(pin);
|
setPinInputHigh_atomic(pin);
|
||||||
|
# endif
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
|
Loading…
Reference in New Issue
Block a user