mirror of
https://github.com/m5stack/meshtastic-device-ui.git
synced 2026-05-20 11:51:03 -07:00
enable custom touch driver w/o IRQ (#149)
This commit is contained in:
@@ -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;
|
||||
};
|
||||
|
||||
|
||||
@@ -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;
|
||||
}
|
||||
|
||||
|
||||
Reference in New Issue
Block a user