From f9364dbe817964c2f70e2c2832a4b5788e983495 Mon Sep 17 00:00:00 2001 From: yanghang Date: Sat, 16 Sep 2023 17:14:39 +0800 Subject: [PATCH] fixed 3ac9c7a from https://gitee.com/kong-wei-111/drivers_hdf_core/pulls/1982 Fix:The pixel Y value on the touch screen of the rk3568 board is too small Signed-off-by: yanghang --- framework/model/input/driver/touchscreen/touch_gt911.c | 5 +++++ 1 file changed, 5 insertions(+) diff --git a/framework/model/input/driver/touchscreen/touch_gt911.c b/framework/model/input/driver/touchscreen/touch_gt911.c index f2ab20be2..f7b8d9432 100644 --- a/framework/model/input/driver/touchscreen/touch_gt911.c +++ b/framework/model/input/driver/touchscreen/touch_gt911.c @@ -15,6 +15,8 @@ #include "touch_gt911.h" #define MAX_POINT 5 +#define COMPENSATION_VALUE_Y 32 +#define UNCONTROLLABLE_VALUE_Y 10 static int32_t ChipInit(ChipDevice *device) { @@ -112,6 +114,9 @@ static void ParsePointData(ChipDevice *device, FrameData *frame, uint8_t *buf, u ((buf[GT_POINT_SIZE * i + GT_X_HIGH] & ONE_BYTE_MASK) << ONE_BYTE_OFFSET)); frame->fingers[i].y = resY - ((buf[GT_POINT_SIZE * i + GT_Y_LOW] & ONE_BYTE_MASK) | ((buf[GT_POINT_SIZE * i + GT_Y_HIGH] & ONE_BYTE_MASK) << ONE_BYTE_OFFSET)); + if (frame->fingers[i].y > UNCONTROLLABLE_VALUE_Y) { + frame->fingers[i].y += COMPENSATION_VALUE_Y; + } #elif defined(LOSCFG_PLATFORM_STM32MP157) frame->fingers[i].x = (buf[GT_POINT_SIZE * i + GT_X_LOW] & ONE_BYTE_MASK) | ((buf[GT_POINT_SIZE * i + GT_X_HIGH] & ONE_BYTE_MASK) << ONE_BYTE_OFFSET); -- Gitee