aboutsummaryrefslogtreecommitdiff
path: root/quantum/encoder.c
diff options
context:
space:
mode:
authorDrashna Jaelre <drashna@live.com>2021-05-21 23:17:32 -0700
committerGitHub <noreply@github.com>2021-05-21 23:17:32 -0700
commita0fed0ea176d1c986e40fc4981b900509c90d66e (patch)
treeee12f5943046015ea0dce8e2a30a68bc8eb99dbe /quantum/encoder.c
parent76c23b15abc824f867b48d8d5100dced2417d336 (diff)
downloadqmk_firmware-a0fed0ea176d1c986e40fc4981b900509c90d66e.tar.gz
qmk_firmware-a0fed0ea176d1c986e40fc4981b900509c90d66e.zip
Convert Encoder callbacks to be boolean functions (#12805)
Co-authored-by: James Young <18669334+noroadsleft@users.noreply.github.com>
Diffstat (limited to 'quantum/encoder.c')
-rw-r--r--quantum/encoder.c10
1 files changed, 5 insertions, 5 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;
59static uint8_t encoder_value[NUMBER_OF_ENCODERS] = {0}; 59static 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
66void encoder_init(void) { 66void 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
97static bool encoder_update(int8_t index, uint8_t state) { 97static 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