Berry 'display.touch_update' wrongly applies resistive calibration (#23363)

This commit is contained in:
s-hadinger 2025-04-30 22:45:19 +02:00 committed by GitHub
parent f72a989976
commit a4ce9efd2c
No known key found for this signature in database
GPG Key ID: B5690EEEBB952194
3 changed files with 6 additions and 3 deletions

View File

@ -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

View File

@ -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
}

View File

@ -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;
if (!force_no_convert) {
TS_RotConvert(&TSGlobal.touch_xp, &TSGlobal.touch_yp);
}
}
// return true if succesful, false if not configured