Watchdog based long press detection#1
Conversation
Trial for individual handling of each button event instead of scanning all buttons at every interrupt.
Longpress detection by watchdog to make the behavior more natural and user friendly
One more step to refactor pushbutton handling from polling and table scans to event controlled, since the trigger is interrupt.
|
Sounds fine what you did, I'll take a look.... Scanning all the GPIO all the time was brute force leftover from the original code, just never felt like changing. Since I don't have time to run a live test, can you make sure there is no recycle in the button pushes. When the long press times out, I would not want it to register a new button push until you let go. I can squash all the commits in to one when it's merged. |
|
It runs on my kitchen radio very well. Frankly speaking the original long push solution was weird. I did not see any side effect with my changes. Anyway, please review thoroughly as I am a hobby programmer only. Further optimisation of the code looks necessary. I am working on that. |
With these changes the long press detection is more natural and user friendly. Long press is activated when the specified time expires and not when the button is released. Furthermore the button press detection is more simple and elegant.
Sorry for the fragmented (and faulty) commits. I am git noob.