diff options
| author | Mikkel Jeppesen <2756925+Duckle29@users.noreply.github.com> | 2020-01-27 05:04:39 +0100 |
|---|---|---|
| committer | Danny <nooges@users.noreply.github.com> | 2020-01-26 23:04:38 -0500 |
| commit | 05d6e6ca78087969d7a47862341d10b6b555c37e (patch) | |
| tree | 5cd80f59929781006d2412a9862a47fc05c4ec7c /quantum/quantum.h | |
| parent | 645c5fabf24411fe65d2172a3509c26e053651a2 (diff) | |
| download | qmk_firmware-05d6e6ca78087969d7a47862341d10b6b555c37e.tar.gz qmk_firmware-05d6e6ca78087969d7a47862341d10b6b555c37e.zip | |
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>
Diffstat (limited to 'quantum/quantum.h')
| -rw-r--r-- | quantum/quantum.h | 3 |
1 files changed, 2 insertions, 1 deletions
diff --git a/quantum/quantum.h b/quantum/quantum.h index 48887026d..3b9eeaa6d 100644 --- a/quantum/quantum.h +++ b/quantum/quantum.h | |||
| @@ -174,7 +174,7 @@ extern layer_state_t layer_state; | |||
| 174 | #if defined(__AVR__) | 174 | #if defined(__AVR__) |
| 175 | typedef uint8_t pin_t; | 175 | typedef uint8_t pin_t; |
| 176 | 176 | ||
| 177 | # define setPinInput(pin) (DDRx_ADDRESS(pin) &= ~_BV((pin)&0xF)) | 177 | # define setPinInput(pin) (DDRx_ADDRESS(pin) &= ~_BV((pin)&0xF), PORTx_ADDRESS(pin) &= ~_BV((pin)&0xF)) |
| 178 | # define setPinInputHigh(pin) (DDRx_ADDRESS(pin) &= ~_BV((pin)&0xF), PORTx_ADDRESS(pin) |= _BV((pin)&0xF)) | 178 | # define setPinInputHigh(pin) (DDRx_ADDRESS(pin) &= ~_BV((pin)&0xF), PORTx_ADDRESS(pin) |= _BV((pin)&0xF)) |
| 179 | # define setPinInputLow(pin) _Static_assert(0, "AVR processors cannot implement an input as pull low") | 179 | # define setPinInputLow(pin) _Static_assert(0, "AVR processors cannot implement an input as pull low") |
| 180 | # define setPinOutput(pin) (DDRx_ADDRESS(pin) |= _BV((pin)&0xF)) | 180 | # define setPinOutput(pin) (DDRx_ADDRESS(pin) |= _BV((pin)&0xF)) |
| @@ -184,6 +184,7 @@ typedef uint8_t pin_t; | |||
| 184 | # define writePin(pin, level) ((level) ? writePinHigh(pin) : writePinLow(pin)) | 184 | # define writePin(pin, level) ((level) ? writePinHigh(pin) : writePinLow(pin)) |
| 185 | 185 | ||
| 186 | # define readPin(pin) ((bool)(PINx_ADDRESS(pin) & _BV((pin)&0xF))) | 186 | # define readPin(pin) ((bool)(PINx_ADDRESS(pin) & _BV((pin)&0xF))) |
| 187 | |||
| 187 | #elif defined(PROTOCOL_CHIBIOS) | 188 | #elif defined(PROTOCOL_CHIBIOS) |
| 188 | typedef ioline_t pin_t; | 189 | typedef ioline_t pin_t; |
| 189 | 190 | ||
