mirror of
https://github.com/meshtastic/firmware.git
synced 2025-06-08 14:12:05 +00:00
fix touchscreen
This commit is contained in:
parent
f6ee533f41
commit
212839bdd3
@ -1795,7 +1795,7 @@ void Screen::setup()
|
||||
new TouchScreenImpl1(dispdev->getWidth(), dispdev->getHeight(), static_cast<TFTDisplay *>(dispdev)->getTouch);
|
||||
touchScreenImpl1->init();
|
||||
}
|
||||
#elif HAS_TOUCHSCREEN
|
||||
#elif HAS_TOUCHSCREEN && !defined(USE_EINK)
|
||||
touchScreenImpl1 =
|
||||
new TouchScreenImpl1(dispdev->getWidth(), dispdev->getHeight(), static_cast<TFTDisplay *>(dispdev)->getTouch);
|
||||
touchScreenImpl1->init();
|
||||
|
@ -19,14 +19,13 @@ void touchISR()
|
||||
|
||||
bool readTouch(int16_t *x, int16_t *y)
|
||||
{
|
||||
if (1 /* intReceived */) {
|
||||
if (intReceived) {
|
||||
intReceived = false;
|
||||
// Reattach the interrupt for the next touch
|
||||
// attachInterrupt (digitalPinToInterrupt(CST328_PIN_INT), touchISR, FALLING);
|
||||
attachInterrupt(digitalPinToInterrupt(CST328_PIN_INT), touchISR, FALLING);
|
||||
|
||||
// Read the touch point
|
||||
// if (tsPanel.isTouched(0)) {
|
||||
if (tsPanel.getTouches()) {
|
||||
if (tsPanel.isTouched(0)) {
|
||||
*x = tsPanel.getPoint(0).x;
|
||||
*y = tsPanel.getPoint(0).y;
|
||||
return true;
|
||||
@ -39,7 +38,7 @@ bool readTouch(int16_t *x, int16_t *y)
|
||||
void lateInitVariant()
|
||||
{
|
||||
tsPanel.begin();
|
||||
// attachInterrupt (digitalPinToInterrupt(CST328_PIN_INT), touchISR, FALLING);
|
||||
attachInterrupt(digitalPinToInterrupt(CST328_PIN_INT), touchISR, FALLING);
|
||||
touchScreenImpl1 = new TouchScreenImpl1(EINK_WIDTH, EINK_HEIGHT, readTouch);
|
||||
touchScreenImpl1->init();
|
||||
}
|
||||
|
@ -10,6 +10,7 @@
|
||||
#define I2C_SCL SCL
|
||||
|
||||
// CST328 touch screen (implementation in src/platform/extra_variants/t_deck_pro/variant.cpp)
|
||||
#define HAS_TOUCHSCREEN 1
|
||||
#define CST328_PIN_INT 12
|
||||
#define CST328_PIN_RST 45
|
||||
|
||||
|
Loading…
Reference in New Issue
Block a user