aboutsummaryrefslogtreecommitdiff
path: root/quantum/encoder.c
diff options
context:
space:
mode:
Diffstat (limited to 'quantum/encoder.c')
-rw-r--r--quantum/encoder.c8
1 files changed, 4 insertions, 4 deletions
diff --git a/quantum/encoder.c b/quantum/encoder.c
index c41b89f49..8e11562eb 100644
--- a/quantum/encoder.c
+++ b/quantum/encoder.c
@@ -37,8 +37,8 @@ static pin_t encoders_pad_b[] = ENCODERS_PAD_B;
37 37
38static int8_t encoder_LUT[] = {0, -1, 1, 0, 1, 0, 0, -1, -1, 0, 0, 1, 0, 1, -1, 0}; 38static int8_t encoder_LUT[] = {0, -1, 1, 0, 1, 0, 0, -1, -1, 0, 0, 1, 0, 1, -1, 0};
39 39
40static uint8_t encoder_state[NUMBER_OF_ENCODERS] = {0}; 40static uint8_t encoder_state[NUMBER_OF_ENCODERS] = {0};
41static int8_t encoder_pulses[NUMBER_OF_ENCODERS] = {0}; 41static int8_t encoder_pulses[NUMBER_OF_ENCODERS] = {0};
42 42
43#ifdef SPLIT_KEYBOARD 43#ifdef SPLIT_KEYBOARD
44// right half encoders come over as second set of encoders 44// right half encoders come over as second set of encoders
@@ -88,7 +88,7 @@ static void encoder_update(int8_t index, uint8_t state) {
88 encoder_value[index]++; 88 encoder_value[index]++;
89 encoder_update_kb(index, true); 89 encoder_update_kb(index, true);
90 } 90 }
91 if (encoder_pulses[i] <= -ENCODER_RESOLUTION) { // direction is arbitrary here, but this clockwise 91 if (encoder_pulses[i] <= -ENCODER_RESOLUTION) { // direction is arbitrary here, but this clockwise
92 encoder_value[index]--; 92 encoder_value[index]--;
93 encoder_update_kb(index, false); 93 encoder_update_kb(index, false);
94 } 94 }
@@ -109,7 +109,7 @@ void encoder_state_raw(uint8_t* slave_state) { memcpy(slave_state, &encoder_valu
109void encoder_update_raw(uint8_t* slave_state) { 109void encoder_update_raw(uint8_t* slave_state) {
110 for (uint8_t i = 0; i < NUMBER_OF_ENCODERS; i++) { 110 for (uint8_t i = 0; i < NUMBER_OF_ENCODERS; i++) {
111 uint8_t index = i + thatHand; 111 uint8_t index = i + thatHand;
112 int8_t delta = slave_state[i] - encoder_value[index]; 112 int8_t delta = slave_state[i] - encoder_value[index];
113 while (delta > 0) { 113 while (delta > 0) {
114 delta--; 114 delta--;
115 encoder_value[index]++; 115 encoder_value[index]++;