diff options
| author | Ryan <fauxpark@gmail.com> | 2024-02-18 17:08:27 +1100 |
|---|---|---|
| committer | GitHub <noreply@github.com> | 2024-02-18 17:08:27 +1100 |
| commit | 2d1aed78a67b3d2b002cc739ef087963b05b76b8 (patch) | |
| tree | ea681d02e547332cffa6b7aec6c16ef37ad70ee3 /quantum/encoder.c | |
| parent | 6810aaf0130113e267e20fb506d874cc858f5f67 (diff) | |
Update GPIO macro usages in core (#23093)
Diffstat (limited to 'quantum/encoder.c')
| -rw-r--r-- | quantum/encoder.c | 8 |
1 files changed, 4 insertions, 4 deletions
diff --git a/quantum/encoder.c b/quantum/encoder.c index 7ab194ed52..efb780c474 100644 --- a/quantum/encoder.c +++ b/quantum/encoder.c | |||
| @@ -162,12 +162,12 @@ void encoder_init(void) { | |||
| 162 | #endif // defined(SPLIT_KEYBOARD) && defined(ENCODER_RESOLUTIONS) | 162 | #endif // defined(SPLIT_KEYBOARD) && defined(ENCODER_RESOLUTIONS) |
| 163 | 163 | ||
| 164 | for (uint8_t i = 0; i < thisCount; i++) { | 164 | for (uint8_t i = 0; i < thisCount; i++) { |
| 165 | setPinInputHigh(encoders_pad_a[i]); | 165 | gpio_set_pin_input_high(encoders_pad_a[i]); |
| 166 | setPinInputHigh(encoders_pad_b[i]); | 166 | gpio_set_pin_input_high(encoders_pad_b[i]); |
| 167 | } | 167 | } |
| 168 | encoder_wait_pullup_charge(); | 168 | encoder_wait_pullup_charge(); |
| 169 | for (uint8_t i = 0; i < thisCount; i++) { | 169 | for (uint8_t i = 0; i < thisCount; i++) { |
| 170 | encoder_state[i] = (readPin(encoders_pad_a[i]) << 0) | (readPin(encoders_pad_b[i]) << 1); | 170 | encoder_state[i] = (gpio_read_pin(encoders_pad_a[i]) << 0) | (gpio_read_pin(encoders_pad_b[i]) << 1); |
| 171 | } | 171 | } |
| 172 | } | 172 | } |
| 173 | 173 | ||
| @@ -247,7 +247,7 @@ static bool encoder_update(uint8_t index, uint8_t state) { | |||
| 247 | bool encoder_read(void) { | 247 | bool encoder_read(void) { |
| 248 | bool changed = false; | 248 | bool changed = false; |
| 249 | for (uint8_t i = 0; i < thisCount; i++) { | 249 | for (uint8_t i = 0; i < thisCount; i++) { |
| 250 | uint8_t new_status = (readPin(encoders_pad_a[i]) << 0) | (readPin(encoders_pad_b[i]) << 1); | 250 | uint8_t new_status = (gpio_read_pin(encoders_pad_a[i]) << 0) | (gpio_read_pin(encoders_pad_b[i]) << 1); |
| 251 | if ((encoder_state[i] & 0x3) != new_status) { | 251 | if ((encoder_state[i] & 0x3) != new_status) { |
| 252 | encoder_state[i] <<= 2; | 252 | encoder_state[i] <<= 2; |
| 253 | encoder_state[i] |= new_status; | 253 | encoder_state[i] |= new_status; |
