From 18f749e185d4a5c78889a9daa42020f08a2f002c Mon Sep 17 00:00:00 2001 From: Manuel <71137295+mverch67@users.noreply.github.com> Date: Sun, 8 Jun 2025 16:38:23 +0200 Subject: [PATCH] enable custom touch driver w/o IRQ (#149) --- include/graphics/LGFX/LGFX_T_DECK.h | 12 ++++++------ include/graphics/driver/LGFXDriver.h | 2 ++ 2 files changed, 8 insertions(+), 6 deletions(-) diff --git a/include/graphics/LGFX/LGFX_T_DECK.h b/include/graphics/LGFX/LGFX_T_DECK.h index 81195b9..d09ac1c 100644 --- a/include/graphics/LGFX/LGFX_T_DECK.h +++ b/include/graphics/LGFX/LGFX_T_DECK.h @@ -50,12 +50,12 @@ class LGFX_Touch : public lgfx::LGFX_Device bool getTouchXY(uint16_t *touchX, uint16_t *touchY) { TOUCHINFO ti; - if (!digitalRead(TOUCH_INT)) - if (bbct.getSamples(&ti)) { - *touchX = ti.x[0]; - *touchY = ti.y[0] - 90; - return true; - } + // if (!digitalRead(TOUCH_INT)) // cannot use as T-Deck Plus has inconsistent factory settings for IRQ pin + if (bbct.getSamples(&ti)) { + *touchX = ti.x[0]; + *touchY = ti.y[0] - 90; + return true; + } return false; }; diff --git a/include/graphics/driver/LGFXDriver.h b/include/graphics/driver/LGFXDriver.h index e13fb79..f5c6a00 100644 --- a/include/graphics/driver/LGFXDriver.h +++ b/include/graphics/driver/LGFXDriver.h @@ -353,6 +353,7 @@ template void LGFXDriver::init_lgfx(void) template bool LGFXDriver::calibrate(uint16_t parameters[8]) { +#ifndef CUSTOM_TOUCH_DRIVER if (parameters[0] || parameters[7]) { ILOG_DEBUG("setting touch screen calibration data"); lgfx->setTouchCalibrate(parameters); @@ -374,6 +375,7 @@ template bool LGFXDriver::calibrate(uint16_t parameters[8]) } ILOG_DEBUG("Touchscreen calibration parameters: {%d, %d, %d, %d, %d, %d, %d, %d}", parameters[0], parameters[1], parameters[2], parameters[3], parameters[4], parameters[5], parameters[6], parameters[7]); +#endif return true; }