diff --git a/src/drv/touch/touch_driver_analog.h b/src/drv/touch/touch_driver_analog.h index a833bc61..7b396d0e 100644 --- a/src/drv/touch/touch_driver_analog.h +++ b/src/drv/touch/touch_driver_analog.h @@ -60,6 +60,7 @@ class AnalogTouch : public BaseTouch { data->point.x = map(tp.x, TS_LEFT, TS_RT, 0, max_x); data->point.y = map(tp.y, TS_BOT, TS_TOP, max_y, 0); data->state = LV_INDEV_STATE_PR; + hasp_set_sleep_offset(0); // Reset the offset } return false; diff --git a/src/drv/touch/touch_driver_ft6336u.h b/src/drv/touch/touch_driver_ft6336u.h index 269889aa..7f7d266d 100644 --- a/src/drv/touch/touch_driver_ft6336u.h +++ b/src/drv/touch/touch_driver_ft6336u.h @@ -65,6 +65,7 @@ class TouchFt6336u : public BaseTouch { data->point.x = ft6336u_touch->read_touch1_x(); data->point.y = ft6336u_touch->read_touch1_y(); data->state = LV_INDEV_STATE_PR; + hasp_set_sleep_offset(0); // Reset the offset } else { data->state = LV_INDEV_STATE_REL; @@ -95,13 +96,13 @@ class TouchFt6336u : public BaseTouch { // handle these events. So instead, we set the INT wire to polled mode, // so it simply goes low as long as there is at least one valid touch. // ft6336u_touch->writeByte(0xA4, 0x00); - /* Wire1.beginTransmission(I2C_TOUCH_ADDRESS); - Wire1.write(0xA4); // address - Wire1.write(0x00); // data - Wire1.endTransmission(); + /* Wire1.beginTransmission(I2C_TOUCH_ADDRESS); + Wire1.write(0xA4); // address + Wire1.write(0x00); // data + Wire1.endTransmission(); - LOG_VERBOSE(TAG_DRVR, F("%s %d"), __FILE__, __LINE__); - touch_scan(Wire1);*/ + LOG_VERBOSE(TAG_DRVR, F("%s %d"), __FILE__, __LINE__); + touch_scan(Wire1);*/ if(ft6336u_touch->read_chip_id() != 0) { LOG_INFO(TAG_DRVR, F("FT6336U touch driver started chipid: %d"), ft6336u_touch->read_chip_id()); diff --git a/src/drv/touch/touch_driver_gslx680.h b/src/drv/touch/touch_driver_gslx680.h index d4e8b9cc..9b7e6015 100644 --- a/src/drv/touch/touch_driver_gslx680.h +++ b/src/drv/touch/touch_driver_gslx680.h @@ -61,6 +61,7 @@ class TouchGsl1680 : public BaseTouch { data->point.y = TFT_HEIGHT; data->state = LV_INDEV_STATE_PR; + hasp_set_sleep_offset(0); // Reset the offset } else { data->state = LV_INDEV_STATE_REL; diff --git a/src/drv/touch/touch_driver_gt911.h b/src/drv/touch/touch_driver_gt911.h index 9c4de324..8f371bb5 100644 --- a/src/drv/touch/touch_driver_gt911.h +++ b/src/drv/touch/touch_driver_gt911.h @@ -78,6 +78,7 @@ class TouchGt911 : public BaseTouch { data->point.x = points[0].x; data->point.y = points[0].y; data->state = LV_INDEV_STATE_PR; + hasp_set_sleep_offset(0); // Reset the offset } else { data->state = LV_INDEV_STATE_REL; diff --git a/src/drv/touch/touch_driver_lovyangfx.h b/src/drv/touch/touch_driver_lovyangfx.h index 60aac548..00561228 100644 --- a/src/drv/touch/touch_driver_lovyangfx.h +++ b/src/drv/touch/touch_driver_lovyangfx.h @@ -46,8 +46,9 @@ class TouchLovyanGfx : public BaseTouch { data->point.x = touchX; data->point.y = touchY; data->state = LV_INDEV_STATE_PR; + hasp_set_sleep_offset(0); // Reset the offset + LOG_VERBOSE(TAG_DRVR, F("Touch: %d %d"), touchX, touchY); - } else { data->state = LV_INDEV_STATE_REL; } diff --git a/src/drv/touch/touch_driver_stmpe610.h b/src/drv/touch/touch_driver_stmpe610.h index fceee412..ea456bb9 100644 --- a/src/drv/touch/touch_driver_stmpe610.h +++ b/src/drv/touch/touch_driver_stmpe610.h @@ -38,6 +38,7 @@ bool touch_read(lv_indev_drv_t* indev_driver, lv_indev_data_t* data) if(point.z && point.x < 4096 && point.y < 4096) { // valid reading if(hasp_sleep_state != HASP_SLEEP_OFF) hasp_update_sleep_state(); // update Idle data->state = LV_INDEV_STATE_PR; + hasp_set_sleep_offset(0); // Reset the offset #if HX8357D_DRIVER == 1 data->point.x = map(point.x, TS_MINX, TS_MAXX, TFT_WIDTH, 0); diff --git a/src/drv/touch/touch_driver_tftespi.h b/src/drv/touch/touch_driver_tftespi.h index 8d2a5e51..f9abcf37 100644 --- a/src/drv/touch/touch_driver_tftespi.h +++ b/src/drv/touch/touch_driver_tftespi.h @@ -38,7 +38,8 @@ class TouchTftEspi : public BaseTouch { if(haspTft.tft.getTouch((uint16_t*)&data->point.x, (uint16_t*)&data->point.y, 300)) { if(hasp_sleep_state != HASP_SLEEP_OFF) hasp_update_sleep_state(); // update Idle data->state = LV_INDEV_STATE_PR; - } else { + hasp_set_sleep_offset(0); // Reset the offset + } else { data->state = LV_INDEV_STATE_REL; }