Add the feature to decide rotate direction of encoder (#2472)

This commit is contained in:
sommermorgentraum 2025-01-09 04:02:05 +08:00 committed by GitHub
parent dfa35b4290
commit 55db0e8c87
No known key found for this signature in database
GPG key ID: B5690EEEBB952194
6 changed files with 49 additions and 17 deletions

View file

@ -66,6 +66,11 @@ int_fast8_t Encoder::update(const uint_fast8_t phase_bits) {
if (direction == prev_direction) {
if ((sensitivity_map[portapack::persistent_memory::encoder_dial_sensitivity()] & (1 << state)) == 0)
return 0;
// true: normal, false: reverse
if (!portapack::persistent_memory::encoder_dial_direction())
direction = -direction;
return direction;
}