InfiniTimeOrg / InfiniTimeOrg/InfiniTime
Tapping button while screen is touched may drop button event
Nobody has claimed this yet.
- Dominant language
- C
- Stars
- 3.4k
- Forks
- 1.1k
- PR merge metrics
- No merged PRs in 30d
Description
Verification
- I searched for similar bug reports (including closed issues) and found none was relevant.
What happened?
Tapping the side button while the screen is touched may drop button toggle events.
What should happen instead?
Tapping the side button while the screen is touched does not drop any events.
Reproduction steps
- Open any app (not necessary but useful for demonstration)
- Hold touch on the screen
- Tap the side button
Possible outcomes:
- The screen goes back to the apps list. This is when the bug fails to trigger. Try again.
- The button press does not go through.
- The screen goes directly to the watch face. At this point you can release the screen touch and wait. It will further go to the watch info page, as though the button was still pressed.
Reproducing this bug should take around 5-10 tries, it's not extremely rare.
More details?
In the third outcome listed where there is still a phantom held button press, the watch will not reset like it normally does if the button is held for a very long time.
I believe the bug is caused by the interrupt mode used for the screen and button. The low accuracy mode used cannot handle more than one active pin at a time (source). Changing the interrupts to use high accuracy mode by changing pinConfig.hi_accuracy on line 155 of src/systemtask/SystemTask.cpp to true does indeed seem to fix this issue, but mark9084 in the Pine64 discord informed me that this could increase power draw by 60uA if the high frequency clock is not already running (they provided this link to relevant documentation) so this may not be a desirable fix.
Version
e03414c
Companion app
No response
Contributor guide
First steps
- Read the whole issue, then the project's contributing guide.
- Comment on the issue to say you are picking it up — it saves two people doing the same work.
- Fork the repository and make your change on a branch.
- Open a pull request that references the issue number.
Research direction
Start in src/systemtask/SystemTask.cpp at the pinConfig.hi_accuracy setting around line 155, then read the linked nRF5 SDK GPIOTE interrupt documentation. Reproduce the issue by holding the screen and tapping the side button, and compare interrupt configurations while considering the documented power-draw tradeoff. Done means button events are not dropped or left phantom-pressed without an unacceptable power impact.
Written by the indexing model from the issue text.
Assessment
- Tech stack
- cpp
- Domain
- embedded-iot
- Issue type
- Bug
- Difficulty
- 4/5
- Estimated time
- 3-5 days
- Activity status
- Stale
- Clarity
- Mostly clear
- Newbie friendliness
- 42/100