Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

fix(radio): various issues with rotary encoder. #5194

Merged
merged 2 commits into from
Jun 21, 2024
Merged

Conversation

philmoz
Copy link
Collaborator

@philmoz philmoz commented Jun 18, 2024

Re-write rotary encoder logic and update Lvgl driver to fix:

  • detection of initial direction of encoder after startup
  • change of direction issue on radios with incorrectly wired encoder
  • handle all wiring variations (without needing special #defines)

May fix #3409

Candidate for 2.10.2

@pfeerick pfeerick added the bug 🪲 Something isn't working label Jun 18, 2024
@pfeerick pfeerick added this to the 2.10.2 milestone Jun 18, 2024
Copy link
Member

@pfeerick pfeerick left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

I've tested TX12, TX12MK2, T20, Zorro, T16, X9D+2019, TX16S-Mk1 and TX16S-Mk2 with this PR, with no issues in radio firmware or bootloader.

I also tested the 2.10 test build of this on TX16S-Mk1, TX16S-Mk2 and T16. philmoz tested on X7S, TX16S Mk2, T20V2, T14, T15 and MT12. Joseph has tested T16 and Mickey has tested TX16S Mk1. So it's been pretty well covered 🤣

I'll leave this until tomorrow to allow for others to review ;)

@philmoz
Copy link
Collaborator Author

philmoz commented Jun 18, 2024

There are some complications arising when the radio is started with the encoder not positioned on a detent.

While this is not a normal state it could happen, and I'm trying to work out a solution.
It's further complicated by radios like the T20, T14 and T15 which have different detent spacing.

(Current 2.10 code also misbehaves if radio is started with encoder not on a detent)

@philmoz
Copy link
Collaborator Author

philmoz commented Jun 19, 2024

Updated to handle the case when the radio is started with the encoder not on a detent position 🤞

Encoder position changes are ignored on startup until it is on a detent.

@pfeerick
Copy link
Member

Repeat testing on T16, TX16 and T20, no problems here, and I can't replicate the "on detent" issue so looks to be solved also.

@pfeerick pfeerick merged commit d84a78c into main Jun 21, 2024
45 checks passed
@pfeerick pfeerick deleted the philmoz/rotenc-update branch June 21, 2024 02:00
pfeerick pushed a commit that referenced this pull request Jun 21, 2024
- detection of initial direction of encoder after startup
- change of direction issue on radios with incorrectly wired encoder
- handle all wiring variations (without needing special #defines)
- handle the case when the radio is started with the encoder not on a detent position
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
bug 🪲 Something isn't working
Projects
None yet
Development

Successfully merging this pull request may close these issues.

first rotary input on the encoder wheel is not used
2 participants