Repository navigation
Touch works in busy games again; SKIP / pause buttons in JK cutscenes; menu taps land - #48
Merged
Merged
Conversation
…; menu taps land Touch in GBA, SNES, Jedi Knight and MotS was laggy or dead, while Genesis and the launcher were fine. The BSP's interrupt task, which reads the touch screen, ran at the BSP's default priority 0, the idle task's: it ran only while every other task waited. A probe at that priority waited up to 40 ms a wake-up in JK / MotS play and lost a third of its runs. (A gamepad hides the touch overlay, so touch looked fine until it was unplugged.) - sdkconfig.defaults: CONFIG_M5STACK_TAB5_INTERRUPT_PRIORITY=21, above the games' main task and the video task (20). The same probe at 21 waits under 0.5 ms. A read is about a millisecond of I2C, and only while a finger is down. - Jedi Knight / MotS cutscenes, the opening crawls included, ignore taps (Escape skips one, Space pauses it). While one plays the touch controls are a SKIP button (Escape) and the pause menu's button, which pauses the cutscene too. - OpenJKDF2 4a881c4c: a tap near a menu control lands on it. The menus' text buttons are about 2.5 mm tall on the Tab5, and finger taps landed a few mm off. Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com> Claude-Session: https://claude.ai/code/session_01SFCMzomCZ5wRHJN4sxwkvY
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
Summary
Touch in GBA, SNES, Jedi Knight and MotS was laggy or dead, while Genesis and the launcher worked.
The cause: the BSP's interrupt task, which reads the touch screen, ran at the BSP's default priority 0, the idle task's level. It only ran while every other task was waiting. A probe at priority 0 waited up to 40 ms per wake-up in JK / MotS play and lost about a third of its runs.
A connected gamepad hides the touch overlay, which is why touch looked fine until the gamepad was unplugged.
sdkconfig.defaults:CONFIG_M5STACK_TAB5_INTERRUPT_PRIORITY=21, above the games' main task and the video task (both 20). The same probe at 21 waits under 0.5 ms. A read is about a millisecond of I2C, and only happens while a finger is down.4a881c4c(ESP32: a tap near a menu control lands on it OpenJKDF2#10, merged): a tap near a menu control lands on it. The menus' text buttons are about 2.5 mm tall on the Tab5, and finger taps landed a few mm off.Testing (Tab5)
Verified with a test build that logged touch reports and the probe every 5 s:
The probe was a test hook and isn't in this PR.
🤖 Generated with Claude Code
https://claude.ai/code/session_01SFCMzomCZ5wRHJN4sxwkvY