diff options
Diffstat (limited to 'quantum')
| -rw-r--r-- | quantum/encoder.c | 14 |
1 files changed, 14 insertions, 0 deletions
diff --git a/quantum/encoder.c b/quantum/encoder.c index 31f00c346..10d8cf7da 100644 --- a/quantum/encoder.c +++ b/quantum/encoder.c | |||
| @@ -16,6 +16,9 @@ | |||
| 16 | */ | 16 | */ |
| 17 | 17 | ||
| 18 | #include "encoder.h" | 18 | #include "encoder.h" |
| 19 | #ifdef SPLIT_KEYBOARD | ||
| 20 | #include "split_util.h" | ||
| 21 | #endif | ||
| 19 | 22 | ||
| 20 | // for memcpy | 23 | // for memcpy |
| 21 | #include <string.h> | 24 | #include <string.h> |
| @@ -54,6 +57,17 @@ void encoder_update_kb(int8_t index, bool clockwise) { | |||
| 54 | } | 57 | } |
| 55 | 58 | ||
| 56 | void encoder_init(void) { | 59 | void encoder_init(void) { |
| 60 | #if defined(SPLIT_KEYBOARD) && defined(ENCODERS_PAD_A_RIGHT) && defined(ENCODERS_PAD_B_RIGHT) | ||
| 61 | if (!isLeftHand) { | ||
| 62 | const pin_t encoders_pad_a_right[] = ENCODERS_PAD_A_RIGHT; | ||
| 63 | const pin_t encoders_pad_b_right[] = ENCODERS_PAD_B_RIGHT; | ||
| 64 | for (uint8_t i = 0; i < NUMBER_OF_ENCODERS; i++) { | ||
| 65 | encoders_pad_a[i] = encoders_pad_a_right[i]; | ||
| 66 | encoders_pad_b[i] = encoders_pad_b_right[i]; | ||
| 67 | } | ||
| 68 | } | ||
| 69 | #endif | ||
| 70 | |||
| 57 | for (int i = 0; i < NUMBER_OF_ENCODERS; i++) { | 71 | for (int i = 0; i < NUMBER_OF_ENCODERS; i++) { |
| 58 | setPinInputHigh(encoders_pad_a[i]); | 72 | setPinInputHigh(encoders_pad_a[i]); |
| 59 | setPinInputHigh(encoders_pad_b[i]); | 73 | setPinInputHigh(encoders_pad_b[i]); |
