Skip to content

Try a lightweight GT911 probe before full reset on EPD-refresh resume#75

Open
balloob wants to merge 1 commit into
OpenDisplay:mainfrom
balloob:perf/touch-resume-probe-first
Open

Try a lightweight GT911 probe before full reset on EPD-refresh resume#75
balloob wants to merge 1 commit into
OpenDisplay:mainfrom
balloob:perf/touch-resume-probe-first

Conversation

@balloob

@balloob balloob commented Jul 3, 2026

Copy link
Copy Markdown
Contributor

Summary

After every EPD refresh, touchResumeAfterEpdRefresh() ran a full GT911 hardware reset through touch_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 path initTouchInput() already uses for a "kept post-EPD" controller. The full touch_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

  • Compiled clean (not flashed) for nrf52840custom and esp32-N4.

⚠️ Needs on-hardware testing with a GT911 touch panel. Touch bring-up timing is device-specific. Please verify after several EPD refreshes that: (1) touch still responds (fast path works), and (2) if you force the controller to drop (e.g. power-cycle its rail), the fallback full reinit still recovers it.

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
@balloob balloob requested a review from jonasniesner as a code owner July 3, 2026 22:14
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

1 participant