Ensure setPinInput actually sets input high-Z (#6237)
* Ensure setPinInput actually sets input high-z * Fixed _PIN_ADDRESS Macro arguments as recommended by vomindoraan * Fixed instances of setInput to use new behavour * Changed kmac matrix to use input with pullups * Update keyboards/gh60/revc/revc.h Co-Authored-By: fauxpark <fauxpark@gmail.com> * Fixed input state for unselect_rows * fixed merge conflict * Updated all instances of older uses of setPinInput() * Fixed naming mistake Co-authored-by: fauxpark <fauxpark@gmail.com>
This commit is contained in:
parent
645c5fabf2
commit
05d6e6ca78
19 changed files with 21 additions and 39 deletions
|
@ -174,7 +174,7 @@ extern layer_state_t layer_state;
|
|||
#if defined(__AVR__)
|
||||
typedef uint8_t pin_t;
|
||||
|
||||
# define setPinInput(pin) (DDRx_ADDRESS(pin) &= ~_BV((pin)&0xF))
|
||||
# define setPinInput(pin) (DDRx_ADDRESS(pin) &= ~_BV((pin)&0xF), PORTx_ADDRESS(pin) &= ~_BV((pin)&0xF))
|
||||
# define setPinInputHigh(pin) (DDRx_ADDRESS(pin) &= ~_BV((pin)&0xF), PORTx_ADDRESS(pin) |= _BV((pin)&0xF))
|
||||
# define setPinInputLow(pin) _Static_assert(0, "AVR processors cannot implement an input as pull low")
|
||||
# define setPinOutput(pin) (DDRx_ADDRESS(pin) |= _BV((pin)&0xF))
|
||||
|
@ -184,6 +184,7 @@ typedef uint8_t pin_t;
|
|||
# define writePin(pin, level) ((level) ? writePinHigh(pin) : writePinLow(pin))
|
||||
|
||||
# define readPin(pin) ((bool)(PINx_ADDRESS(pin) & _BV((pin)&0xF)))
|
||||
|
||||
#elif defined(PROTOCOL_CHIBIOS)
|
||||
typedef ioline_t pin_t;
|
||||
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue