From: penglei <1624952103@qq.com> Date: Wed, 8 Jan 2025 03:45:14 +0000 (+0800) Subject: 优化蓝牙产测马达测试,4G测试,优化心率初始化 X-Git-Tag: v1.3.113-repair_tp~39^2~8 X-Git-Url: http://git.snicker.com.cn/css/static/gitweb.css?a=commitdiff_plain;h=refs%2Fchanges%2F1600%2Fhead;p=mirrors%2FFD230.git 优化蓝牙产测马达测试,4G测试,优化心率初始化 --- 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 2bffc865e..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: 2025-01-06 16:20:03 + * @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, @@ -1787,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; @@ -1804,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, @@ -1817,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/service/ppg_service.cpp b/code/sdk/drivers/peripheral/ppg/service/ppg_service.cpp index 9ca14e4f4..939918e69 100644 --- a/code/sdk/drivers/peripheral/ppg/service/ppg_service.cpp +++ b/code/sdk/drivers/peripheral/ppg/service/ppg_service.cpp @@ -400,10 +400,16 @@ errcode_t uapi_ppg_service_init(void) tyhx_poweron(); 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);//注册驱动回调