2nd-Level Encoder Debouncing for scrappy encoder dials (#1838)

* Experimental encoder debouncing

* Experimental encoder debouncing

* Clang

* Comment changed
This commit is contained in:
Mark Thompson 2024-02-01 14:13:28 -06:00 committed by GitHub
parent a2a5fb166e
commit ee2e57d702
No known key found for this signature in database
GPG key ID: B5690EEEBB952194
3 changed files with 45 additions and 71 deletions

View file

@ -162,8 +162,7 @@ static bool switches_update(const uint8_t raw) {
}
static bool encoder_update(const uint8_t raw) {
// TODO: swap +1/-1 directions in encoder.update() to avoid needless swizzing of phase bits here
return encoder_debounce.feed(((raw >> 7) & 0x01) | ((raw >> 5) & 0x02));
return encoder_debounce.feed(raw >> 6);
}
static bool encoder_read() {