diff options
Diffstat (limited to 'quantum')
-rw-r--r-- | quantum/encoder.c | 10 | ||||
-rw-r--r-- | quantum/encoder.h | 4 | ||||
-rw-r--r-- | quantum/quantum.h | 4 |
3 files changed, 11 insertions, 7 deletions
diff --git a/quantum/encoder.c b/quantum/encoder.c index 2ed64c1e3..c30bf01cb 100644 --- a/quantum/encoder.c +++ b/quantum/encoder.c | |||
@@ -59,9 +59,9 @@ static uint8_t thisHand, thatHand; | |||
59 | static uint8_t encoder_value[NUMBER_OF_ENCODERS] = {0}; | 59 | static uint8_t encoder_value[NUMBER_OF_ENCODERS] = {0}; |
60 | #endif | 60 | #endif |
61 | 61 | ||
62 | __attribute__((weak)) void encoder_update_user(int8_t index, bool clockwise) {} | 62 | __attribute__((weak)) bool encoder_update_user(uint8_t index, bool clockwise) { return true; } |
63 | 63 | ||
64 | __attribute__((weak)) void encoder_update_kb(int8_t index, bool clockwise) { encoder_update_user(index, clockwise); } | 64 | __attribute__((weak)) bool encoder_update_kb(uint8_t index, bool clockwise) { return encoder_update_user(index, clockwise); } |
65 | 65 | ||
66 | void encoder_init(void) { | 66 | void encoder_init(void) { |
67 | #if defined(SPLIT_KEYBOARD) && defined(ENCODERS_PAD_A_RIGHT) && defined(ENCODERS_PAD_B_RIGHT) | 67 | #if defined(SPLIT_KEYBOARD) && defined(ENCODERS_PAD_A_RIGHT) && defined(ENCODERS_PAD_B_RIGHT) |
@@ -94,14 +94,14 @@ void encoder_init(void) { | |||
94 | #endif | 94 | #endif |
95 | } | 95 | } |
96 | 96 | ||
97 | static bool encoder_update(int8_t index, uint8_t state) { | 97 | static bool encoder_update(uint8_t index, uint8_t state) { |
98 | bool changed = false; | 98 | bool changed = false; |
99 | uint8_t i = index; | 99 | uint8_t i = index; |
100 | 100 | ||
101 | #ifdef ENCODER_RESOLUTIONS | 101 | #ifdef ENCODER_RESOLUTIONS |
102 | int8_t resolution = encoder_resolutions[i]; | 102 | uint8_t resolution = encoder_resolutions[i]; |
103 | #else | 103 | #else |
104 | int8_t resolution = ENCODER_RESOLUTION; | 104 | uint8_t resolution = ENCODER_RESOLUTION; |
105 | #endif | 105 | #endif |
106 | 106 | ||
107 | #ifdef SPLIT_KEYBOARD | 107 | #ifdef SPLIT_KEYBOARD |
diff --git a/quantum/encoder.h b/quantum/encoder.h index db6f220da..25dc77721 100644 --- a/quantum/encoder.h +++ b/quantum/encoder.h | |||
@@ -22,8 +22,8 @@ | |||
22 | void encoder_init(void); | 22 | void encoder_init(void); |
23 | bool encoder_read(void); | 23 | bool encoder_read(void); |
24 | 24 | ||
25 | void encoder_update_kb(int8_t index, bool clockwise); | 25 | bool encoder_update_kb(uint8_t index, bool clockwise); |
26 | void encoder_update_user(int8_t index, bool clockwise); | 26 | bool encoder_update_user(uint8_t index, bool clockwise); |
27 | 27 | ||
28 | #ifdef SPLIT_KEYBOARD | 28 | #ifdef SPLIT_KEYBOARD |
29 | void encoder_state_raw(uint8_t* slave_state); | 29 | void encoder_state_raw(uint8_t* slave_state); |
diff --git a/quantum/quantum.h b/quantum/quantum.h index fe6bf310a..e4a7c5723 100644 --- a/quantum/quantum.h +++ b/quantum/quantum.h | |||
@@ -200,6 +200,10 @@ extern layer_state_t layer_state; | |||
200 | # include "usbpd.h" | 200 | # include "usbpd.h" |
201 | #endif | 201 | #endif |
202 | 202 | ||
203 | #ifdef ENCODER_ENABLE | ||
204 | # include "encoder.h" | ||
205 | #endif | ||
206 | |||
203 | // For tri-layer | 207 | // For tri-layer |
204 | void update_tri_layer(uint8_t layer1, uint8_t layer2, uint8_t layer3); | 208 | void update_tri_layer(uint8_t layer1, uint8_t layer2, uint8_t layer3); |
205 | layer_state_t update_tri_layer_state(layer_state_t state, uint8_t layer1, uint8_t layer2, uint8_t layer3); | 209 | layer_state_t update_tri_layer_state(layer_state_t state, uint8_t layer1, uint8_t layer2, uint8_t layer3); |