From a4ce9efd2cd12081a2aaeff27225fef21985adde Mon Sep 17 00:00:00 2001 From: s-hadinger <49731213+s-hadinger@users.noreply.github.com> Date: Wed, 30 Apr 2025 22:45:19 +0200 Subject: [PATCH] Berry 'display.touch_update' wrongly applies resistive calibration (#23363) --- CHANGELOG.md | 1 + tasmota/tasmota_xdrv_driver/xdrv_52_3_berry_display.ino | 2 +- tasmota/tasmota_xdrv_driver/xdrv_55_touch.ino | 6 ++++-- 3 files changed, 6 insertions(+), 3 deletions(-) diff --git a/CHANGELOG.md b/CHANGELOG.md index 37387db7a..73e6211e0 100644 --- a/CHANGELOG.md +++ b/CHANGELOG.md @@ -21,6 +21,7 @@ All notable changes to this project will be documented in this file. ### Fixed - Berry `bytes().asstring()` now truncates a string if buffer contains NULL (#23311) - Berry string literals containing NULL are truncated (#23312) +- Berry `display.touch_update` wrongly applies resistive calibration ### Removed diff --git a/tasmota/tasmota_xdrv_driver/xdrv_52_3_berry_display.ino b/tasmota/tasmota_xdrv_driver/xdrv_52_3_berry_display.ino index 263893afd..07554d9d3 100644 --- a/tasmota/tasmota_xdrv_driver/xdrv_52_3_berry_display.ino +++ b/tasmota/tasmota_xdrv_driver/xdrv_52_3_berry_display.ino @@ -75,7 +75,7 @@ extern "C" { void be_ntv_display_touch_update(int32_t touches, int32_t raw_x, int32_t raw_y, int32_t gesture) { #if defined(USE_UNIVERSAL_TOUCH) || defined(USE_FT5206) || defined(USE_XPT2046) || defined(USE_GT911) || defined(USE_LILYGO47) || defined(USE_TOUCH_BUTTONS) - Touch_SetStatus(touches, raw_x, raw_y, gesture); + Touch_SetStatus(touches, raw_x, raw_y, gesture,true /*don't convert*/); #endif } diff --git a/tasmota/tasmota_xdrv_driver/xdrv_55_touch.ino b/tasmota/tasmota_xdrv_driver/xdrv_55_touch.ino index c3ff07870..2a2e81793 100644 --- a/tasmota/tasmota_xdrv_driver/xdrv_55_touch.ino +++ b/tasmota/tasmota_xdrv_driver/xdrv_55_touch.ino @@ -82,14 +82,16 @@ bool utouch_found = false; VButton *buttons[MAX_TOUCH_BUTTONS]; #endif -void Touch_SetStatus(uint8_t touches, uint16_t raw_x, uint16_t raw_y, uint8_t gesture) { +void Touch_SetStatus(uint8_t touches, uint16_t raw_x, uint16_t raw_y, uint8_t gesture, bool force_no_convert) { TSGlobal.external_ts = true; TSGlobal.gesture = gesture; TSGlobal.touches = touches; TSGlobal.touched = (TSGlobal.touches > 0); TSGlobal.touch_xp = TSGlobal.raw_touch_xp = raw_x; TSGlobal.touch_yp = TSGlobal.raw_touch_yp = raw_y; - TS_RotConvert(&TSGlobal.touch_xp, &TSGlobal.touch_yp); + if (!force_no_convert) { + TS_RotConvert(&TSGlobal.touch_xp, &TSGlobal.touch_yp); + } } // return true if succesful, false if not configured