mirror of
https://github.com/HASwitchPlate/openHASP.git
synced 2025-07-25 20:26:41 +00:00
Reset sleep offset on local touch
This commit is contained in:
parent
f0443301cc
commit
83011d3330
@ -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;
|
||||
|
@ -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;
|
||||
|
@ -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;
|
||||
|
@ -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;
|
||||
|
@ -46,8 +46,9 @@ class TouchLovyanGfx : public BaseTouch {
|
||||
data->point.x = touchX;
|
||||
data->point.y = touchY;
|
||||
data->state = LV_INDEV_STATE_PR;
|
||||
LOG_VERBOSE(TAG_DRVR, F("Touch: %d %d"), touchX, touchY);
|
||||
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;
|
||||
}
|
||||
|
@ -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);
|
||||
|
@ -38,6 +38,7 @@ 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;
|
||||
hasp_set_sleep_offset(0); // Reset the offset
|
||||
} else {
|
||||
data->state = LV_INDEV_STATE_REL;
|
||||
}
|
||||
|
Loading…
x
Reference in New Issue
Block a user