Try a lightweight GT911 probe before full reset on EPD-refresh resume#75
Open
balloob wants to merge 1 commit into
Open
Try a lightweight GT911 probe before full reset on EPD-refresh resume#75balloob wants to merge 1 commit into
balloob wants to merge 1 commit into
Conversation
touchResumeAfterEpdRefresh() ran a full GT911 hardware reset via touch_reinit_gt911() -> gt911_resolve_and_init() after every EPD refresh, adding ~500-700 ms of blocking delays (reset pulse + settle + address re-resolution) per controller while buttons/BLE stall. Add touch_light_resume_gt911(): probe the PID at the last-known address, and if the controller still answers, just clear status and re-attach the INT with no hardware reset (the same fast path initTouchInput() already uses for a kept-post-EPD controller). Fall back to the full touch_reinit_gt911() only when the probe fails, so a controller that did drop out is still recovered. Co-Authored-By: Claude Opus 4.8 <noreply@anthropic.com> Claude-Session: https://claude.ai/code/session_01MgW3EZCfMkGFffseDPwV74
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
After every EPD refresh,
touchResumeAfterEpdRefresh()ran a full GT911 hardware reset throughtouch_reinit_gt911()→gt911_resolve_and_init()— a reset pulse plus fixed settle delays plus address re-resolution, roughly 500–700 ms of blocking work per controller during which buttons and BLE stall. In the common case the controller is still alive at its known address, so the full reset is wasted.Fix
Add
touch_light_resume_gt911(): read the GT911 product ID at the last-known address, and if it still answers, just clear the status register and re-attach the interrupt — no reset, no address scan. This is the same lightweight pathinitTouchInput()already uses for a "kept post-EPD" controller. The fulltouch_reinit_gt911()is used only as a fallback when the probe fails, so a controller that genuinely dropped out is still recovered. The one-time bus invalidate + settle before the loop is unchanged.Verification
nrf52840customandesp32-N4.