From 747716b88e2ae8a4738606da41bbcf23d22b8ac8 Mon Sep 17 00:00:00 2001 From: Ivan Kuleshov Date: Mon, 3 Aug 2026 19:16:38 +0200 Subject: [PATCH] fix(t-deck): restore CALIBRATE_TOUCH so the touch panel is calibrated The T-Deck touch panel has been uncalibrated on the MUI build since #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 8ae05f6b ("MUI: defcon tft display size definitions", #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) --- variants/esp32s3/t-deck/platformio.ini | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/variants/esp32s3/t-deck/platformio.ini b/variants/esp32s3/t-deck/platformio.ini index aba1695cecd..30beb142ded 100644 --- a/variants/esp32s3/t-deck/platformio.ini +++ b/variants/esp32s3/t-deck/platformio.ini @@ -69,7 +69,7 @@ build_flags = -D RADIOLIB_DEBUG_SPI=0 -D RADIOLIB_DEBUG_PROTOCOL=0 -D RADIOLIB_SPI_PARANOID=0 -; -D CALIBRATE_TOUCH=0 + -D CALIBRATE_TOUCH=0 -D LGFX_SCREEN_WIDTH=240 -D LGFX_SCREEN_HEIGHT=320 -D LGFX_BUFSIZE=153600