From: SnickerSun Date: Thu, 21 Nov 2024 15:27:15 +0000 (+0800) Subject: tp增加失效后的复原操作 X-Git-Tag: fd230_release_V1.3.102~49^2~3 X-Git-Url: http://git.snicker.com.cn/css/static/script.js?a=commitdiff_plain;h=d1e1fd3b7c497636168de52f0ab108381259df15;p=mirrors%2FFD230.git tp增加失效后的复原操作 --- 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 1a7b331ce..23e43a8b1 100644 --- a/code/sdk/drivers/peripheral/touch/ft6x46_touch/ft6x46_touch1.c +++ b/code/sdk/drivers/peripheral/touch/ft6x46_touch/ft6x46_touch1.c @@ -339,9 +339,16 @@ ext_errno ft6x46_irq_callback(uint8_t *data_buf, uint8_t data_len) g_ft6x46_drv.touch_msg.tp_event = MC_TP_INVALID; int32_t mem_ret; - - fts_touch_process(); - + static int fail_count = 0; + if (fts_touch_process() != ERRCODE_SUCC) + { + fail_count ++ ; + }else{ + fail_count = 0; + } + if (fail_count > 10){ + hal_custom_resume_touch(); + } mem_ret = memcpy_s(data_buf, sizeof(input_event_info), &(g_ft6x46_drv.touch_msg), sizeof(input_event_info)); if (mem_ret != EOK) { diff --git a/code/sdk/drivers/peripheral/touch/touch_screen_drv.c b/code/sdk/drivers/peripheral/touch/touch_screen_drv.c index e45b30ed7..c78a42982 100644 --- a/code/sdk/drivers/peripheral/touch/touch_screen_drv.c +++ b/code/sdk/drivers/peripheral/touch/touch_screen_drv.c @@ -448,7 +448,7 @@ void touch_screen_suspend(void) void touch_screen_resume(void) { - uint32_t irq_sts = osal_irq_lock(); + // uint32_t irq_sts = osal_irq_lock(); uapi_gpio_disable_interrupt(TOUCH_INT_GPIO); // close tp_int gpio interrupt i2c_recovery_reg(TOUCH_I2C_BUS); #if defined(TPTYPE_TMA525B) @@ -459,12 +459,15 @@ void touch_screen_resume(void) #elif defined(TPTYPE_ZTW523) ztw523_resume(); #elif defined(TPTYPE_FT6X46) - ft6x46_resume(); + if( ft6x46_resume() != ERRCODE_SUCC) + { + ft6x46_resume(); + } #else ztw523_resume(); #endif uapi_gpio_enable_interrupt(TOUCH_INT_GPIO); // open tp_int gpio interrupt - osal_irq_restore(irq_sts); + // osal_irq_restore(irq_sts); } void touch_suspend_for_i2c(void)