From 5ebc5dda83caef920153445ed37537259de4c08a Mon Sep 17 00:00:00 2001 From: SnickerSun Date: Thu, 21 Nov 2024 18:14:50 +0800 Subject: [PATCH] =?utf8?q?=E4=BC=98=E5=8C=96TP=E9=A9=B1=E5=8A=A8=EF=BC=8C?= =?utf8?q?=E9=99=8D=E4=BD=8E=E9=80=9F=E7=8E=87=EF=BC=8C=E4=BC=98=E5=8C=96r?= =?utf8?q?eset=E6=97=B6=E5=BA=8F?= MIME-Version: 1.0 Content-Type: text/plain; charset=utf8 Content-Transfer-Encoding: 8bit --- .../touch/ft6x46_touch/ft6x46_ctrl.c | 2 +- .../touch/ft6x46_touch/ft6x46_touch1.c | 30 +++++-------------- 2 files changed, 8 insertions(+), 24 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 f6a42fdb1..753f2d81b 100644 --- a/code/sdk/drivers/peripheral/touch/ft6x46_touch/ft6x46_ctrl.c +++ b/code/sdk/drivers/peripheral/touch/ft6x46_touch/ft6x46_ctrl.c @@ -337,7 +337,7 @@ ext_errno ft6x46_host_peripheral_init(ft6x46_ctrl_attr *attr) /* init i2c */ errcode_t result; - result = uapi_i2c_master_init(FT6X46_I2C_BUS, 400000, I2C_SPEED_MODE_FS); /* 400000: 400KHz */ + result = uapi_i2c_master_init(FT6X46_I2C_BUS, 100000, I2C_SPEED_MODE_SS); /* 400000: 400KHz */ if (result != EXT_ERR_SUCCESS) { tp_err("tp i2c init fail! ret=0x%x", result); return EXT_ERR_SUCCESS; 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 85f2db5a9..1a7b331ce 100644 --- a/code/sdk/drivers/peripheral/touch/ft6x46_touch/ft6x46_touch1.c +++ b/code/sdk/drivers/peripheral/touch/ft6x46_touch/ft6x46_touch1.c @@ -726,33 +726,17 @@ ext_errno ft6x46_resume(void) ft6x46_resume_reset(); - // for (; retry_times < FT6X46_INIT_RETRY_TIMERS; retry_times++) { - // ret = ft6x46_resume_post(); - // if (ret != EXT_ERR_SUCCESS) { - // tp_err("resume: post err %d", ret); - // /* retry delay 200ms */ - // osDelay(FT6X46_GENERAL_DELAY_200); - // } else { - // break; - // } - // } - - // if (retry_times == FT6X46_INIT_RETRY_TIMERS) { - // tp_err("resume: overtimes %d", retry_times); - // goto resume_exit; - // } - ret = ft6x46_config(); + /* Step 2 power up */ + ret = ft6x46_power_sequence(); if (ret != EXT_ERR_SUCCESS) { - tp_err("TOUCH:ft6x46 init fail 0x%x", ret); - goto resume_exit; + tp_err("TOUCH:init powerup fail 0x%x", ret); + goto resume_exit; } - // ret = ft6x46_configuration(); - // if (ret != EXT_ERR_SUCCESS) { - // tp_err("TOUCH:resume config fail 0x%x", ret); - // return EXT_ERR_TP_ZTW523_INIT_CONFIG; - // } + /* Record Status For Init */ + g_ft6x46_drv.chip_status = FT6X46_READY; g_ft6x46_drv.work_status = FT6X46_WORK_NORMAL; + #ifdef FT6X46_GESTURE_WAKEUP g_ft6x46_drv.gesture_wakeup = TD_FALSE; #endif -- 2.17.1