stmpe610 fix ghost touches

This commit is contained in:
alex 2024-12-25 17:37:24 +01:00
parent 70c262ebae
commit c3a3222e4a

View File

@ -29,8 +29,7 @@ bool touch_read(lv_indev_drv_t* indev_driver, lv_indev_data_t* data)
data->state = LV_INDEV_STATE_REL; data->state = LV_INDEV_STATE_REL;
// while touched, but the state is released => read next point // while touched, but the state is released => read next point
while(data->state == LV_INDEV_STATE_REL && stmpe610_touchpanel.touched()) { while(data->state == LV_INDEV_STATE_REL && !stmpe610_touchpanel.bufferEmpty()) {
TS_Point point = stmpe610_touchpanel.getPoint(); TS_Point point = stmpe610_touchpanel.getPoint();
Log.trace(TAG_DRVR, F("STMPE610: x=%i y=%i z=%i"), point.x, point.y, point.z); Log.trace(TAG_DRVR, F("STMPE610: x=%i y=%i z=%i"), point.x, point.y, point.z);