From 5fa0e771e459405287c1915da7d0b09e4fdef570 Mon Sep 17 00:00:00 2001 From: SnickerSun Date: Fri, 22 Nov 2024 14:46:03 +0800 Subject: [PATCH] =?utf8?q?=E4=BC=98=E5=8C=96tp=E9=A9=B1=E5=8A=A8?= MIME-Version: 1.0 Content-Type: text/plain; charset=utf8 Content-Transfer-Encoding: 8bit --- .../drivers/peripheral/touch/ft6x46_touch/ft6x46_ctrl.c | 2 +- .../drivers/peripheral/touch/ft6x46_touch/ft6x46_touch1.c | 8 +++++++- code/sdk/drivers/peripheral/touch/touch_screen_drv.c | 5 +++-- 3 files changed, 11 insertions(+), 4 deletions(-) diff --git a/code/sdk/drivers/peripheral/touch/ft6x46_touch/ft6x46_ctrl.c b/code/sdk/drivers/peripheral/touch/ft6x46_touch/ft6x46_ctrl.c index 753f2d81b..0fcc4f219 100644 --- a/code/sdk/drivers/peripheral/touch/ft6x46_touch/ft6x46_ctrl.c +++ b/code/sdk/drivers/peripheral/touch/ft6x46_touch/ft6x46_ctrl.c @@ -392,6 +392,6 @@ void ft6x46_resume_reset(void) uapi_gpio_set_val(FT6X46_RESET_GPIO, GPIO_LEVEL_HIGH); /* delay 100ms */ osDelay(200); - uapi_gpio_set_dir(FT6X46_RESET_GPIO, GPIO_DIRECTION_INPUT); + // uapi_gpio_set_dir(FT6X46_RESET_GPIO, GPIO_DIRECTION_INPUT); } diff --git a/code/sdk/drivers/peripheral/touch/ft6x46_touch/ft6x46_touch1.c b/code/sdk/drivers/peripheral/touch/ft6x46_touch/ft6x46_touch1.c index 23e43a8b1..abd5f0b6a 100644 --- a/code/sdk/drivers/peripheral/touch/ft6x46_touch/ft6x46_touch1.c +++ b/code/sdk/drivers/peripheral/touch/ft6x46_touch/ft6x46_touch1.c @@ -340,13 +340,19 @@ ext_errno ft6x46_irq_callback(uint8_t *data_buf, uint8_t data_len) int32_t mem_ret; static int fail_count = 0; + if (g_ft6x46_drv.work_status != FT6X46_WORK_NORMAL) { + tp_print("TOUCH:ft6x46_irq_callback not in normal mode skip read touch"); + return ERRCODE_FAIL; + } + if (fts_touch_process() != ERRCODE_SUCC) { fail_count ++ ; }else{ fail_count = 0; } - if (fail_count > 10){ + if (fail_count%50 == 49){ + tp_print("TOUCH:ft6x46_irq_callback fail to reset touch "); hal_custom_resume_touch(); } diff --git a/code/sdk/drivers/peripheral/touch/touch_screen_drv.c b/code/sdk/drivers/peripheral/touch/touch_screen_drv.c index c78a42982..e115d19e9 100644 --- a/code/sdk/drivers/peripheral/touch/touch_screen_drv.c +++ b/code/sdk/drivers/peripheral/touch/touch_screen_drv.c @@ -437,9 +437,10 @@ void touch_screen_suspend(void) if (ret != EXT_ERR_SUCCESS) { tp_err("touch sleep ret=0x%x", ret); } #if defined(TPTYPE_FT6X46) if (ft6x46_suspend() == EXT_ERR_SUCCESS){ - i2c_save_reg(TOUCH_I2C_BUS); - uapi_gpio_disable_interrupt(TOUCH_INT_GPIO); // close tp_int gpio interrupt + } + i2c_save_reg(TOUCH_I2C_BUS); + uapi_gpio_disable_interrupt(TOUCH_INT_GPIO); // close tp_int gpio interrupt #else i2c_save_reg(TOUCH_I2C_BUS); uapi_gpio_disable_interrupt(TOUCH_INT_GPIO); // close tp_int gpio interrupt -- 2.17.1