fix(t-deck): restore CALIBRATE_TOUCH so the touch panel is calibrated - #11349
fix(t-deck): restore CALIBRATE_TOUCH so the touch panel is calibrated#11349merocle wants to merge 1 commit into
Conversation
The T-Deck touch panel has been uncalibrated on the MUI build since meshtastic#7142. device-ui carries calibration parameters for this board and applies them in LGFXDriver.h, but the whole block is behind `#ifdef CALIBRATE_TOUCH`. That flag was active for t-deck-tft until 8ae05f6 ("MUI: defcon tft display size definitions", meshtastic#7142) commented it out while adding LGFX_SCREEN_WIDTH and LGFX_SCREEN_HEIGHT. Neither that PR's description nor its discussion mentions touch, so the change looks unintended. Without the flag no calibration is applied at all and the panel runs on raw LovyanGFX values: a touch lands off by the 320/240 ratio, stretched by about 1.33 on X and compressed by about 0.8 on Y, accurate only near the bottom-left corner and worse with distance from it. Restoring the line makes touch accurate across the screen. CALIBRATE_TOUCH=0 applies the stored parameters; 1 would run interactive calibration, which does not persist yet. Co-Authored-By: Claude Opus 5 (1M context) <noreply@anthropic.com>
|
|
@merocle, Welcome to Meshtastic!Thanks for opening your first pull request. We really appreciate it. We discuss work as a team in discord, please join us in the #firmware channel. Welcome to the team 😄 |
|
Important Review skippedAuto reviews are disabled on base/target branches other than the default branch. Please check the settings in the CodeRabbit UI or the ⚙️ Run configurationConfiguration used: Organization UI Review profile: CHILL Plan: Pro Plus Run ID: You can disable this status message by setting the Use the checkbox below for a quick retry:
Thanks for using CodeRabbit! It's free for OSS, and your support helps us grow. If you like it, consider giving us a shout-out. Comment |
|
Please retarget this change to |
mverch67
left a comment
There was a problem hiding this comment.
Display calibration may be individual for each display, that's why there's a calibration function in Settings->Screen Calibration. Though I agree that some default values may be better than nothing, especially if the lovyanGFX default is so far off that the settings button cannot be reached.
Upon startup these default values are overwritten with the stored values (from the last screen calibration) in NodeDB.
@mverch67 Alternatively. Can we prompt for screen calibration upon firstboot? (If a previous calibration is not already stored). |
that's also possible, yes. But there's already another prompt in place to set username / region. So we'd had two prompts (and for sure could think about having even more prompts), lol. |
|
@merocle last request to rebase this one liner onto develop, or i will do it myself and close this one. |
Problem
The T-Deck touch panel is uncalibrated on the MUI build (
t-deck-tft): a touch registers off by the 320/240 ratio — stretched by about 1.33 on X, compressed by about 0.8 on Y — accurate only near the bottom-left corner and worse with distance from it.Cause
device-uiships calibration parameters for this board and applies them ininclude/graphics/driver/LGFXDriver.h:The whole block is behind
#ifdef CALIBRATE_TOUCH. That flag was active fort-deck-tftuntil 8ae05f6 ("MUI: defcon tft display size definitions", #7142, 2025-06-26) commented it out while addingLGFX_SCREEN_WIDTH/LGFX_SCREEN_HEIGHT:Neither that PR's description nor its discussion mentions touch, so this looks unintended. With the flag gone no calibration is applied at all and the panel runs on raw LovyanGFX values.
Fix
Uncomment the line.
CALIBRATE_TOUCH=0applies the stored parameters;=1would run interactive calibration, which does not persist yet — there is aFIXMEindevice-uiabout reading it back from storage.Testing
Built
t-deck-tftat v2.7.26.54e0d8d with this change and flashed app0 on a T-Deck Plus (868 MHz). Touch is accurate across the whole screen afterwards; before the change it missed as described above. LoRa, keyboard and trackball unaffected.Not addressed here
t-deckis the only variant that setsCALIBRATE_TOUCH, so the calibration block indevice-uiis currently dead code for every board, even though it also carries parameters forWT32_SC01,T_HMI,ESP32_2432S022,ESP32_2432S028RV1,UNPHONE,NODEMCU_32SandSENSECAP_INDICATOR. I do not have those boards, so this PR touches one line rather than all of them.🤝 Attestations
I have a T-Deck Plus and a Heltec V4 only. The change is scoped to the
t-deckvariant's build flags, so other boards cannot be affected.