enable custom touch driver w/o IRQ (#149)

This commit is contained in:
Manuel
2025-06-08 16:38:23 +02:00
committed by GitHub
parent 2fd19f813d
commit 18f749e185
2 changed files with 8 additions and 6 deletions
+6 -6
View File
@@ -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;
};
+2
View File
@@ -353,6 +353,7 @@ template <class LGFX> void LGFXDriver<LGFX>::init_lgfx(void)
template <class LGFX> bool LGFXDriver<LGFX>::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 <class LGFX> bool LGFXDriver<LGFX>::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;
}