From 5d458907cbb7706bf656cb53bd18361609010cc9 Mon Sep 17 00:00:00 2001 From: zhao_hanqing Date: Thu, 12 Sep 2024 16:16:59 +0800 Subject: [PATCH 1/2] =?UTF-8?q?=E3=80=90=E9=A9=B1=E5=8A=A8=E5=AD=90?= =?UTF-8?q?=E7=B3=BB=E7=BB=9F=E3=80=91=E3=80=90input=E3=80=91=E4=BF=AE?= =?UTF-8?q?=E5=A4=8D=E6=96=B0=E6=97=A7rk3568=E5=8D=95=E6=9D=BF=E8=A7=A6?= =?UTF-8?q?=E6=91=B8=E5=B1=8F=E5=B7=A6=E4=B8=8A=E8=A7=92=E8=A7=A6=E6=91=B8?= =?UTF-8?q?=E4=B8=8D=E7=81=B5=E6=95=8F=E7=9A=84=E9=97=AE=E9=A2=98?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit Signed-off-by: zhao_hanqing --- .../model/input/driver/touchscreen/touch_gt911.c | 16 +++++++++------- 1 file changed, 9 insertions(+), 7 deletions(-) diff --git a/framework/model/input/driver/touchscreen/touch_gt911.c b/framework/model/input/driver/touchscreen/touch_gt911.c index 074c40d98..110661821 100644 --- a/framework/model/input/driver/touchscreen/touch_gt911.c +++ b/framework/model/input/driver/touchscreen/touch_gt911.c @@ -18,6 +18,7 @@ #if defined(CONFIG_ARCH_ROCKCHIP) #define GT5688_FIRMWARE_VERSION 256 #define GT911_FIRMWARE_VERSION 4192 +static bool GT5688 = false; #endif #define FOUR_BYTES 4 @@ -64,13 +65,13 @@ static int32_t ChipDetect(ChipDevice *device) switch (version) { case GT5688_FIRMWARE_VERSION: HDF_LOGI("%s:TOUCH IC is GT5688", __func__); + GT5688 = true; break; case GT911_FIRMWARE_VERSION: HDF_LOGI("%s:TOUCH IC is GT911", __func__); break; default: HDF_LOGE("%s: ID wrong,IC FW version is %d", __func__, version); - return HDF_FAILURE; } #endif if (buf[GT_FW_VER_HIGH] == 0x0) { @@ -123,12 +124,13 @@ static void ChipVersionDefault(ChipDevice *device, FrameData *frame, const uint8 ((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 < GT_Y_OFFSET_A) { - frame->fingers[i].y += CORRECTION_VALUE_A; - } else if (frame->fingers[i].y < GT_Y_OFFSET_B) { - frame->fingers[i].y += CORRECTION_VALUE_B; - } else if (frame->fingers[i].y < GT_Y_OFFSET_C) { - frame->fingers[i].y += CORRECTION_VALUE_C; + if (GT5688) { + if (frame->fingers[i].y < GT_Y_OFFSET_A) + frame->fingers[i].y += CORRECTION_VALUE_A; + else if (frame->fingers[i].y < GT_Y_OFFSET_B) + frame->fingers[i].y += CORRECTION_VALUE_B; + else if (frame->fingers[i].y < GT_Y_OFFSET_C) + frame->fingers[i].y += CORRECTION_VALUE_C; } #elif defined(LOSCFG_PLATFORM_STM32MP157) frame->fingers[i].x = (buf[GT_POINT_SIZE * i + GT_X_LOW] & ONE_BYTE_MASK) | -- Gitee From 3d3c4f954b89bd0584095914408579d3577a43d4 Mon Sep 17 00:00:00 2001 From: zhao_hanqing0201 Date: Fri, 11 Oct 2024 08:06:57 +0000 Subject: [PATCH 2/2] update framework/model/input/driver/touchscreen/touch_gt911.c. Signed-off-by: zhao_hanqing0201 --- framework/model/input/driver/touchscreen/touch_gt911.c | 6 +++--- 1 file changed, 3 insertions(+), 3 deletions(-) diff --git a/framework/model/input/driver/touchscreen/touch_gt911.c b/framework/model/input/driver/touchscreen/touch_gt911.c index 110661821..1f19c4369 100644 --- a/framework/model/input/driver/touchscreen/touch_gt911.c +++ b/framework/model/input/driver/touchscreen/touch_gt911.c @@ -18,7 +18,7 @@ #if defined(CONFIG_ARCH_ROCKCHIP) #define GT5688_FIRMWARE_VERSION 256 #define GT911_FIRMWARE_VERSION 4192 -static bool GT5688 = false; +static bool g_isGT5688 = false; #endif #define FOUR_BYTES 4 @@ -65,7 +65,7 @@ static int32_t ChipDetect(ChipDevice *device) switch (version) { case GT5688_FIRMWARE_VERSION: HDF_LOGI("%s:TOUCH IC is GT5688", __func__); - GT5688 = true; + g_isGT5688 = true; break; case GT911_FIRMWARE_VERSION: HDF_LOGI("%s:TOUCH IC is GT911", __func__); @@ -124,7 +124,7 @@ static void ChipVersionDefault(ChipDevice *device, FrameData *frame, const uint8 ((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 (GT5688) { + if (g_isGT5688) { if (frame->fingers[i].y < GT_Y_OFFSET_A) frame->fingers[i].y += CORRECTION_VALUE_A; else if (frame->fingers[i].y < GT_Y_OFFSET_B) -- Gitee