Skip to content

Feature/t5s3 epaper inkhud fixes#10287

Open
giannoug wants to merge 6 commits intomeshtastic:developfrom
giannoug:feature/t5s3-epaper-inkhud-fixes
Open

Feature/t5s3 epaper inkhud fixes#10287
giannoug wants to merge 6 commits intomeshtastic:developfrom
giannoug:feature/t5s3-epaper-inkhud-fixes

Conversation

@giannoug
Copy link
Copy Markdown
Contributor

T5-S3-ePaper-Pro InkHUD: touch nav fixes, home button, margin cleanup

Fixes and improvements to the LilyGo T5-E-Paper-S3-Pro InkHUD port, all tested on hardware.

Touch navigation fixes

  • TouchInkHUDBridge: swipe-left/right in system applet context (menu, keyboard) was calling navUp()/navDown() instead of navLeft()/navRight(). Fixed.
  • TOUCH_THRESHOLD_X reduced 60→40 to match TOUCH_THRESHOLD_Y, improving horizontal swipe sensitivity.
  • Joystick alignment moved to post-begin() so it is set alongside the other enforced joystick settings.

GT911 hardware home button

Wires the GT911's physical home button to InkHUD::longpress() via setHomeButtonCallback(), giving users a dedicated button to open/close the menu. 400 ms debounce prevents multiple fires per press. InkHUD builds only.

ED047TC1 display margins

Increased safe-area margins from ~8–9 px to 16 px on all sides (H_OFFSET_BYTES 1→2, V_OFFSET_TOP/BOTTOM 9/8→16/16), ensuring content clears the panel's inactive border at all rotations. Safe area: 928×508 px (was 944×523). Removes the EINK_EDGE_LINES calibration diagnostic left over from development.

Duplicate symbol fix

The fcb9ec0c refactor on develop moved T5S3 touch/InkHUD code to src/platform/extra_variants/. A merge left the old copy in variants/esp32s3/t5s3_epaper/variant.cpp, causing a link error. Removed the duplicate.


Attempted: touch-to-wake from deep sleep (not included)

Investigated using GT911 INT (GPIO3, valid RTC GPIO) as an EXT1 wakeup source. Boot button (GPIO0) EXT1 works; GPIO3 does not, despite: leaving GT911 active (command 0x05 is full host-controlled sleep), calling esp_sleep_enable_ext1_wakeup() last in variant_shutdown(), explicit rtc_gpio_init() + rtc_gpio_pullup_en(), and draining the touch buffer before sleep. Root cause unresolved — likely GT911 not asserting INT during host deep sleep (possibly a power rail issue). Deferred.

A fix to SensorLib's GT911::sleep() (upstream leaves INT as OUTPUT LOW, blocking any future EXT1 wakeup) will be submitted to lewisxhe/SensorLib separately.


🤝 Attestations

  • I have tested that my proposed changes behave as described.
  • I have tested that my proposed changes do not cause any obvious regressions on the following devices:
    • Heltec (Lora32) V3
    • LilyGo T-Deck
    • LilyGo T-Beam
    • RAK WisBlock 4631
    • Seeed Studio T-1000E tracker card
    • Other: LilyGo T5-E-Paper-S3-Pro (H752-01, V2) — all changes tested on hardware

giannoug and others added 6 commits April 23, 2026 20:26
…erge

The merge of master into develop (fcb9ec0) added
src/platform/extra_variants/t5s3_epaper/variant.cpp with the full
board implementation (touch, readTouch, lateInitVariant), but a
merge conflict left variants/esp32s3/t5s3_epaper/variant.cpp with
its original full content too — causing multiple definition errors
at link time.

Reduce variants/esp32s3/t5s3_epaper/variant.cpp to only the two
functions not present in extra_variants: earlyInitVariant() and
variant_shutdown(), matching the pattern used by t-deck-pro.

Co-Authored-By: Claude Sonnet 4.6 <noreply@anthropic.com>
Tested on device — 16px uniform margins look noticeably cleaner than
the previous asymmetric 8–9px values. Canvas shrinks from 944×523 to
928×508 (H_OFFSET_BYTES=2, V_OFFSET_TOP/BOTTOM=16).

Co-Authored-By: Claude Sonnet 4.6 <noreply@anthropic.com>
- Fix keyboard navigation: map swipe LEFT/RIGHT to navLeft/navRight
  instead of navUp/navDown so horizontal cursor movement works in the
  on-screen keyboard (freeTextMode). Menu back and confirm via
  LEFT/RIGHT swipe; vertical scroll via UP/DOWN as before.

- Fix joystick alignment ownership: remove dead pre-begin alignment
  assignment (overwritten by loadSettings); move it into post-begin
  enforcement block alongside enabled/aligned. Restore per-touch
  alignment update in TouchInkHUDBridge so rotation changes via the
  InkHUD menu self-heal on the next touch.

- Lower TOUCH_THRESHOLD_X from 60 to 40: log analysis showed
  legitimate short swipes (~41px) being misclassified as taps.
  Threshold is now symmetric with TOUCH_THRESHOLD_Y to handle
  axis-swap on rotation changes.

Co-Authored-By: Claude Sonnet 4.6 <noreply@anthropic.com>
The GT911 touch controller reports a hardware home button via the
haveKey bit in its point info register, surfaced through SensorLib's
setHomeButtonCallback(). Wire this to inkhud->longpress() (open menu /
back) with a 400ms debounce to suppress repeated callbacks while held.

Co-Authored-By: Claude Sonnet 4.6 <noreply@anthropic.com>
…ED047TC1

Co-Authored-By: Claude Sonnet 4.6 <noreply@anthropic.com>
@github-actions github-actions Bot added the hardware-support Hardware related: new devices or modules, problems specific to hardware label Apr 24, 2026
@giannoug
Copy link
Copy Markdown
Contributor Author

The PR title should be fix(t5s3-epaper): InkHUD touch nav, home button, display margins, but I can’t edit it.

@HarukiToreda
Copy link
Copy Markdown
Contributor

I would advice submitting part of this PR once this other one is approved. We have already stablished plans for a full touch UI so some fixes here may be null.
#10286

@giannoug
Copy link
Copy Markdown
Contributor Author

Sure, no problem. If there's a plan or general direction for this device I would like to help!

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

hardware-support Hardware related: new devices or modules, problems specific to hardware

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants