From d922aa7beb387e9cb6ff8acc8e44c68c9b04dee4 Mon Sep 17 00:00:00 2001 From: Stephan Hadinger Date: Fri, 28 Jan 2022 08:56:00 +0100 Subject: [PATCH] LVGL log TS when released --- tasmota/xdrv_55_touch.ino | 6 ++++++ 1 file changed, 6 insertions(+) diff --git a/tasmota/xdrv_55_touch.ino b/tasmota/xdrv_55_touch.ino index d553f419c..77850acf9 100644 --- a/tasmota/xdrv_55_touch.ino +++ b/tasmota/xdrv_55_touch.ino @@ -130,6 +130,7 @@ int16_t XPT2046_y() { void Touch_Check(void(*rotconvert)(int16_t *x, int16_t *y)) { + static bool was_touched = false; // flag used to log the data sent when the screen was just released #ifdef USE_FT5206 if (FT5206_found) { @@ -154,6 +155,7 @@ void Touch_Check(void(*rotconvert)(int16_t *x, int16_t *y)) { raw_touch_xp = touch_xp; raw_touch_yp = touch_yp; if (touched) { + was_touched = true; #ifdef USE_TOUCH_BUTTONS #ifdef USE_M5STACK_CORE2 // handle 3 built in touch buttons @@ -183,6 +185,10 @@ void Touch_Check(void(*rotconvert)(int16_t *x, int16_t *y)) { #endif // USE_TOUCH_BUTTONS } else { + if (was_touched) { + AddLog(LOG_LEVEL_DEBUG_MORE, "TS : released x=%i y=%i (raw x=%i y=%i)", touch_xp, touch_yp, raw_touch_xp, raw_touch_yp); + was_touched = false; + } #ifdef USE_M5STACK_CORE2 for (uint32_t tbut = 0; tbut < 3; tbut++) { if (tbstate[tbut] & 1) {