summaryrefslogtreecommitdiff
path: root/quantum/encoder.c
diff options
context:
space:
mode:
authorNick Brassel <nick@tzarc.org>2021-08-29 08:20:25 +1000
committerNick Brassel <nick@tzarc.org>2021-08-29 08:20:25 +1000
commitf061ca497464fe85284906fb163a33eaee7a91ef (patch)
tree33ef1bfb529aed382e8526c607c4e18717f92571 /quantum/encoder.c
parentff65185dec6f97be1eb49f17cea526a0d0bbf3d6 (diff)
parent4bad375d7c09d949a9dcdd4feba147c9c7a67ec6 (diff)
Breaking changes develop merge to master, 2021Q3 edition. (#14196)
Diffstat (limited to 'quantum/encoder.c')
-rw-r--r--quantum/encoder.c5
1 files changed, 5 insertions, 0 deletions
diff --git a/quantum/encoder.c b/quantum/encoder.c
index c30bf01cb2..8fb87281c2 100644
--- a/quantum/encoder.c
+++ b/quantum/encoder.c
@@ -119,6 +119,11 @@ static bool encoder_update(uint8_t index, uint8_t state) {
encoder_update_kb(index, ENCODER_CLOCKWISE);
}
encoder_pulses[i] %= resolution;
+#ifdef ENCODER_DEFAULT_POS
+ if ((state & 0x3) == ENCODER_DEFAULT_POS) {
+ encoder_pulses[i] = 0;
+ }
+#endif
return changed;
}