From a0a38f638af840d8dc8e9ad6e762844459187a55 Mon Sep 17 00:00:00 2001 From: Stephan Hadinger Date: Wed, 26 Jan 2022 16:20:48 +0100 Subject: [PATCH] Update touchscreen x/y only when touched --- tasmota/xdrv_55_touch.ino | 12 ++++++++---- 1 file changed, 8 insertions(+), 4 deletions(-) diff --git a/tasmota/xdrv_55_touch.ino b/tasmota/xdrv_55_touch.ino index 02d415e4a..d553f419c 100644 --- a/tasmota/xdrv_55_touch.ino +++ b/tasmota/xdrv_55_touch.ino @@ -133,17 +133,21 @@ void Touch_Check(void(*rotconvert)(int16_t *x, int16_t *y)) { #ifdef USE_FT5206 if (FT5206_found) { - touch_xp = FT5206_x(); - touch_yp = FT5206_y(); touched = FT5206_touched(); + if (touched) { + touch_xp = FT5206_x(); + touch_yp = FT5206_y(); + } } #endif // USE_FT5206 #ifdef USE_XPT2046 if (XPT2046_found) { - touch_xp = XPT2046_x(); - touch_yp = XPT2046_y(); touched = XPT2046_touched(); + if (touched) { + touch_xp = XPT2046_x(); + touch_yp = XPT2046_y(); + } } #endif // USE_XPT2046