T-Lora Pager: Fully fix rotary encoder and speaker fuzzing/popping#7986
Conversation
mverch67
left a comment
There was a problem hiding this comment.
I was also thinking to use a queue to dispatch events from the interrupt handler but the current behavior was sufficient for me so I didn't spent the effort.
The measured power consumption during light sleep was 36mA. Switching off the peripherals before light sleep didn't save any power. In deep sleep it's 65μA. |
|
eargerly awaiting this being merged, rotary encoder as it stands is really broken |
|
Ah, need a tag for "hardware-support" to pass pull requirements |
|
possibly on hold, would like feedback on this #7989 (comment) as it would provide a standard interface for other input subsystems to do what this pr does to get more reliable inputs without duplicating code and having multiple background threads |
|
Interesting thread, definitely like the idea of centralizing input events in a more streamlined way, should help deal with a greater variety of form factors going forward. |
|
i reworked it based on the system i made for #7989 , seems to work great and means the 2 systems will not duplicate necessary resources for thread/queue etc... they have 1 commit in common implementing the underlying system, thats why it may look similar. merging either PR first will be fine, then can just merge develop into the other PR. |
|
not sure if i need to do something to fix CI on this and keyboard improvements PR EDIT: ah i see its a build fail, i hadnt scrolled up enough |
|
I'm so glad I came across this PR! I had actually started working on these fixes myself. I managed to get the rotary encoder working by refactoring RotaryEncoderImpl to behave like LILYGO’s examples. The encoder worked fine, but navigation felt a bit laggy (yours is much smoother!). I wasn’t sure if that was a Meshtastic, display, or hardware limitation, so I stopped there. The popping noise though... This PR works perfectly on my hardware and fixes both of the issues I was experiencing! Navigation is smooth, and there’s no popping. I’m also interested in adding a Greek font for displaying messages and a Greek keyboard layout. Before I spend time on it and possibly hit a dead end, should I start working on it now or wait for the -tft release (or something else)? Maybe I could open a new issue so we can discuss it there? |
|
Regarding Greek font and layout, probably best to open an issue for discussion |
|
FWIW, I merged this into my own repo that was synced off of today's develop branch and the scroll wheel is SO MUCH BETTER. |
i have my 4 currently open PRs for tlora pager and cardputer adv and the multi message storage branch from meshtastic repo merged in my fork's develop branch as ive been dogfooding them on my device, if you wanna try the keyboard improvements and rtc too |
|
fixes #8258 |
|
I'm having some kind of timing issues with heltecv3 and rotary encoder running the latest firmware (master branch), but it's that, it goes the wrong direction 30-40% of the time. Any pointers on how this was tested on heltecv3? Pins used? I read somewhere I need to make sure the pins support interrupt.. Tried different pins and different encoder parts, and even setting a couple different deBounceMs delays in the code to no avail. It's the GPIO encoder type. |
|
@jeremyd this PR is specific to T-Lora Pager, afaik no other devices currently use the same FSM rotary encoder. also, heltecv3 has no rotary encoder, so there is nothing to test. if you added your own rotary encoder to your specific device, thats not something that someone else can test. |
Oh ok, sorry, I was reading it and it had the " I have tested that my proposed changes do not cause any obvious regressions on the following devices: heltecv3". No worries, yeah I think the rotary encoder I'm trying to use, does not act the same I suppose, as what the firmware is expecting. |
InputPollablesystem inInputBrokerthat allows for polling inputs right after an interrupt so no events are missed, which standardizes the process explained above so other input sources can use it (eg TCA8418 in TCA8418, T-Lora Pager, T-Deck Pro: Keyboard improvements #7989, the code for this is the same, feel free to merge either PR first)InputEventsources inherit fromInputPollable(like they did withObservable<const InputEvent *>pollOnce()method on the input source class, this will be run from userspace so it can do whateverpollOnce()add events withinputBroker->queueInputEvent(&event)(instead ofthis->notifyObservers(&event)with previous system)inputBroker->pollSoonRequestFromIsr(this)(thisbeing the input event source class which inherits fromInputPollable)pollOnce()byInputBrokeras soon as the interrupt handler exits, bypassing cooperative multitasking delay of OSThread, providing much better responsiveness and avoiding missed inputs, and avoiding unnecessary periodic pollinginputBroker->queueInputEvent(&event)inpollOnce(), they will be processed by GUI and other modules on the main thread when possible viainputBroker->processInputEventQueue()which is shared among all input event sources that use this paradigm🤝 Attestations