From: 彭磊 <1624952103@qq.com> Date: Wed, 8 Jan 2025 06:15:08 +0000 (+0000) Subject: Merge #1600 into sdk602patch0911 from refs/changes/1600/head X-Git-Tag: v1.3.113-repair_tp~48 X-Git-Url: http://git.snicker.com.cn/css/static/gitweb.css?a=commitdiff_plain;h=fa0a9a976e605a186df10abdb1d0be04e38b5015;p=mirrors%2FFD230.git Merge #1600 into sdk602patch0911 from refs/changes/1600/head Code review from 彭磊 * refs/changes/1600/head: (7 commits squashed) - 功耗runtime增加运动事件上报 - Merge branch 'sdk602patch0911' of https://codeup.aliyun.com/64191456b9581d62e8f81ac0/FD230 into sdk602patch0911 - Merge branch 'sdk602patch0911' of https://codeup.aliyun.com/64191456b9581d62e8f81ac0/FD230 into sdk602patch0911 - 优化产测读取心率id,优化读取老化测试标志 - 优化产测读取心率id,优化读取老化测试标志(补) - Merge branch 'sdk602patch0911' of https://codeup.aliyun.com/64191456b9581d62e8f81ac0/FD230 into sdk602patch0911 - 优化蓝牙产测马达测试,4G测试,优化心率初始化 Signed-off-by: aliyun6865282430 <1624952103@qq.com> Reviewed-by: Caisking <3449750381@qq.com> Reviewed-by: 罗正 <1732036298@qq.com> Reviewed-by: aliyun8003852482 <1224667075@qq.com> Reviewed-by: snickersun@163.com Reviewed-by: aliyun6865282430 <1624952103@qq.com> Merged-by: Caisking <3449750381@qq.com> CR-link: https://codeup.aliyun.com/64191456b9581d62e8f81ac0/FD230/change/1600 --- diff --git a/code/sdk/application/wearable/service/factorytest_service/factorytest_protocol.c b/code/sdk/application/wearable/service/factorytest_service/factorytest_protocol.c index 41cdfd472..bd29009fe 100644 --- a/code/sdk/application/wearable/service/factorytest_service/factorytest_protocol.c +++ b/code/sdk/application/wearable/service/factorytest_service/factorytest_protocol.c @@ -2,7 +2,7 @@ * @Author: penglei 1624952103@qq.com * @Date: 2024-06-17 14:31:08 * @LastEditors: penglei 1624952103@qq.com - * @LastEditTime: 2024-11-23 16:04:42 + * @LastEditTime: 2025-01-08 11:44:08 * @FilePath: /FD230/code/sdk/application/wearable/service/factorytest_service/factorytest_protocol.c * @Description: * @@ -763,9 +763,11 @@ void factorytest_protocol_soft_test_decode(uint8_t submode,uint8_t testitem,uint //打开马达 uint8_t send_data = 0x00; - g_ble_vibrator_timer = osTimerNew((osTimerFunc_t)ble_vibrator_check_timer_callback, osTimerPeriodic, NULL, NULL); + if(g_ble_vibrator_timer == NULL) + g_ble_vibrator_timer = osTimerNew((osTimerFunc_t)ble_vibrator_check_timer_callback, osTimerPeriodic, NULL, NULL); - osTimerStart(g_ble_vibrator_timer,500); + if(g_ble_vibrator_timer) + osTimerStart(g_ble_vibrator_timer,500); factorytest_protocol_replymsg(BLE_TEST_CMD_MODE_SOFT_TEST, BLE_TEST_CMD_SOFT_TEST_SUB_MODE_VIBRATOR, @@ -778,8 +780,9 @@ void factorytest_protocol_soft_test_decode(uint8_t submode,uint8_t testitem,uint //关闭马达 uint8_t send_data = 0x00; - osTimerStop(g_ble_vibrator_timer); - osTimerDelete(g_ble_vibrator_timer); + if(g_ble_vibrator_timer) + osTimerStop(g_ble_vibrator_timer); + // osTimerDelete(g_ble_vibrator_timer); factorytest_protocol_replymsg(BLE_TEST_CMD_MODE_SOFT_TEST, BLE_TEST_CMD_SOFT_TEST_SUB_MODE_VIBRATOR, @@ -982,10 +985,12 @@ void factorytest_protocol_soft_test_decode(uint8_t submode,uint8_t testitem,uint { //查询老化标志 uint8_t send_data[3] = {0}; + do_custom_fileoperate_service_check_msg(CUSTOM_FILEOPERATE_MSG_TYPE_AGING_DATA_READ, NULL, 0); + LOS_Msleep(500); - send_data[1] = aging_t.flag; + send_data[1] = aging_result_t.flag; - if(aging_t.fail_num != 0) + if(aging_result_t.fail_num != 0) { send_data[2] = 0x01; } @@ -1358,6 +1363,11 @@ void factorytest_protocol_soft_test_decode(uint8_t submode,uint8_t testitem,uint //获取 ppg_id uint8_t ppg_id; uapi_ppg_get_id(&ppg_id); + if(ppg_id != 0x65) + { + hx3695_chip_check(); + uapi_ppg_get_id(&ppg_id); + } factorytest_protocol_replymsg(BLE_TEST_CMD_MODE_SOFT_TEST, BLE_TEST_CMD_SOFT_TEST_SUB_MODE_HRS, 0x01, @@ -1780,7 +1790,7 @@ void factorytest_protocol_soft_test_decode(uint8_t submode,uint8_t testitem,uint //设置强收模式 uint8_t send_data = 0; cat1_at_cmd("at+QRFTESTMODE=1"); - LOS_Msleep(500); + LOS_Msleep(1000); ble_get_cat1_at_msg((char *)&send_data,1); if(atol(send_data) == 0) send_data = 1; @@ -1797,7 +1807,7 @@ void factorytest_protocol_soft_test_decode(uint8_t submode,uint8_t testitem,uint char buf[20] = {0}; uint8_t send_data[2] = {0}; cat1_at_cmd("AT+QRXFTM=\"LTE BAND1\",300,\"on\",75"); - LOS_Msleep(500); + LOS_Msleep(1000); ble_get_cat1_at_msg(buf,20); sscanf(buf, "+QRXFTM: -%d,-%d", (int *)&send_data[0], (int *)&send_data[1]); factorytest_protocol_replymsg(BLE_TEST_CMD_MODE_SOFT_TEST, @@ -1810,7 +1820,7 @@ void factorytest_protocol_soft_test_decode(uint8_t submode,uint8_t testitem,uint //关闭强接受 uint8_t send_data = 0; cat1_at_cmd("AT+QRXFTM=\"LTE BAND1\",300,\"off\",75"); - LOS_Msleep(500); + LOS_Msleep(1000); ble_get_cat1_at_msg((char *)&send_data,1); if(atol(send_data) == 0) send_data = 1; diff --git a/code/sdk/drivers/peripheral/ppg/hx3695/hx3695.c b/code/sdk/drivers/peripheral/ppg/hx3695/hx3695.c index 891767708..8feed29f5 100644 --- a/code/sdk/drivers/peripheral/ppg/hx3695/hx3695.c +++ b/code/sdk/drivers/peripheral/ppg/hx3695/hx3695.c @@ -369,7 +369,7 @@ bool hx3695_chip_check(void) uint8_t i = 0; uint8_t chip_id = 0; hx3695_chip_id = 0; - for(i=0; i<5; i++) + for(i=0; i<10; i++) { hx3695_ppg_on(); hx3695_delay_ms(5); diff --git a/code/sdk/drivers/peripheral/ppg/service/ppg_service.cpp b/code/sdk/drivers/peripheral/ppg/service/ppg_service.cpp index f5014efeb..939918e69 100644 --- a/code/sdk/drivers/peripheral/ppg/service/ppg_service.cpp +++ b/code/sdk/drivers/peripheral/ppg/service/ppg_service.cpp @@ -398,12 +398,18 @@ errcode_t uapi_ppg_service_init(void) #ifdef PPG_HX3695 tyhx_poweron(); - if ( hx3695_chip_check_id() == false) + if ( hx3695_chip_check() == false) { - //TODO 没找到3695,退出线程 - PRINT("3695 not exist!\r\n"); tyhx_poweroff(); - return ERRCODE_FAIL; + LOS_Mdelay(10); + tyhx_poweron(); + if ( hx3695_chip_check() == false) + { + //TODO 没找到3695,退出线程 + PRINT("3695 not exist!\r\n"); + tyhx_poweroff(); + return ERRCODE_FAIL; + } } tyhx_poweroff(); hx3695_register_msg_callback(hx3695_msg_callback);//注册驱动回调