diff options
Diffstat (limited to 'quantum/encoder.c')
| -rw-r--r-- | quantum/encoder.c | 10 |
1 files changed, 4 insertions, 6 deletions
diff --git a/quantum/encoder.c b/quantum/encoder.c index ddf6234ab..31f00c346 100644 --- a/quantum/encoder.c +++ b/quantum/encoder.c | |||
| @@ -25,16 +25,14 @@ | |||
| 25 | #define ENCODER_RESOLUTION 4 | 25 | #define ENCODER_RESOLUTION 4 |
| 26 | #endif | 26 | #endif |
| 27 | 27 | ||
| 28 | #ifndef NUMBER_OF_ENCODERS | ||
| 29 | #error "Number of encoders not defined by NUMBER_OF_ENCODERS" | ||
| 30 | #endif | ||
| 31 | |||
| 32 | #if !defined(ENCODERS_PAD_A) || !defined(ENCODERS_PAD_B) | 28 | #if !defined(ENCODERS_PAD_A) || !defined(ENCODERS_PAD_B) |
| 33 | #error "No encoder pads defined by ENCODERS_PAD_A and ENCODERS_PAD_B" | 29 | #error "No encoder pads defined by ENCODERS_PAD_A and ENCODERS_PAD_B" |
| 34 | #endif | 30 | #endif |
| 35 | 31 | ||
| 36 | static pin_t encoders_pad_a[NUMBER_OF_ENCODERS] = ENCODERS_PAD_A; | 32 | |
| 37 | static pin_t encoders_pad_b[NUMBER_OF_ENCODERS] = ENCODERS_PAD_B; | 33 | #define NUMBER_OF_ENCODERS (sizeof(encoders_pad_a)/sizeof(pin_t)) |
| 34 | static pin_t encoders_pad_a[] = ENCODERS_PAD_A; | ||
| 35 | static pin_t encoders_pad_b[] = ENCODERS_PAD_B; | ||
| 38 | 36 | ||
| 39 | static int8_t encoder_LUT[] = { 0, -1, 1, 0, 1, 0, 0, -1, -1, 0, 0, 1, 0, 1, -1, 0 }; | 37 | static int8_t encoder_LUT[] = { 0, -1, 1, 0, 1, 0, 0, -1, -1, 0, 0, 1, 0, 1, -1, 0 }; |
| 40 | 38 | ||
