From: SnickerSun Date: Fri, 22 Nov 2024 06:46:03 +0000 (+0800) Subject: 优化tp驱动 X-Git-Tag: fd230_release_V1.3.102~46^2~2 X-Git-Url: http://git.snicker.com.cn/css/static/gitweb.css?a=commitdiff_plain;h=5fa0e771e459405287c1915da7d0b09e4fdef570;p=mirrors%2FFD230.git 优化tp驱动 --- 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