From d2490ec3f5d9c0c6ed7e9c7ee17702e3a017fe00 Mon Sep 17 00:00:00 2001 From: penglei <1624952103@qq.com> Date: Wed, 12 Jun 2024 10:02:05 +0800 Subject: [PATCH] =?utf8?q?=E4=BC=98=E5=8C=96=E8=93=9D=E7=89=99=E4=BA=A7?= =?utf8?q?=E6=B5=8B=EF=BC=8C=E8=A7=A3=E5=86=B3=E8=A1=A8=E7=9B=98=E6=8C=87?= =?utf8?q?=E5=8D=97=E9=92=88=E6=A0=A1=E5=87=86=E4=B8=8D=E8=BF=87=E7=9A=84?= =?utf8?q?=E9=97=AE=E9=A2=98?= MIME-Version: 1.0 Content-Type: text/plain; charset=utf8 Content-Transfer-Encoding: 8bit --- .../compass/src/CompassControlView.cpp | 6 +- .../factorytest_protocol.c | 159 +++++++----------- .../peripheral/mag/mmc5603/mmc5603_main.c | 2 +- .../peripheral/mag/service/mag_service.c | 4 +- 4 files changed, 70 insertions(+), 101 deletions(-) diff --git a/code/sdk/application/wearable/fd230app/nativeui/compass/src/CompassControlView.cpp b/code/sdk/application/wearable/fd230app/nativeui/compass/src/CompassControlView.cpp index 71dcefcae..3121836ba 100644 --- a/code/sdk/application/wearable/fd230app/nativeui/compass/src/CompassControlView.cpp +++ b/code/sdk/application/wearable/fd230app/nativeui/compass/src/CompassControlView.cpp @@ -71,9 +71,9 @@ bool CompassControlView::InitView(void) void CompassControlView::SetCalibrationView(bool flag) { - if (flag == isCalibration) { - return; - } + // if (flag == isCalibration) { + // return; + // } if (flag) { compassCalibrationView->SetVisible(true); 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 af5956d18..203ad16af 100644 --- a/code/sdk/application/wearable/service/factorytest_service/factorytest_protocol.c +++ b/code/sdk/application/wearable/service/factorytest_service/factorytest_protocol.c @@ -68,11 +68,6 @@ static osTimerId_t g_ble_acc_timer; static osTimerId_t g_ble_hrs_timer; static osTimerId_t g_ble_spo2_timer; -static osTimerId_t g_ble_graycard_timer; -static osTimerId_t g_ble_leaklight_timer; - -static uint8_t graycard_flag = 0; -static uint8_t leaklight_flag = 0; static uint32_t aging_time = 0; @@ -210,93 +205,6 @@ void ble_spo2_check_timer_callback(void) } -void ble_graycard_check_timer_callback(void) -{ - if(graycard_flag == 10) - { - graycard_flag = 0; - osTimerStop(g_ble_graycard_timer); - osTimerDelete(g_ble_graycard_timer); - return; - } - send_ppg_cmd_msg(PPG_SERVICE_CMD_TYPE_DO_GRAYCARD_TEST); - FT_RESULTS_t ft_result = hx3695_factroy_test(GRAY_CARD_TEST); - send_ppg_cmd_msg(PPG_SERVICE_CMD_TYPE_STOP_PPG_TEST); - uint8_t databuf[12] = {0}; - - databuf[0] = (uint8_t)((ft_result.gr_data_final & 0xFF000000) >> 24); - databuf[1] = (uint8_t)((ft_result.gr_data_final & 0x00FF0000) >> 16); - databuf[2] = (uint8_t)((ft_result.gr_data_final & 0x0000FF00) >> 8); - databuf[3] = (uint8_t)((ft_result.gr_data_final & 0x000000FF) >> 0); - - databuf[4] = (uint8_t)((ft_result.red_data_final & 0xFF000000) >> 24); - databuf[5] = (uint8_t)((ft_result.red_data_final & 0x00FF0000) >> 16); - databuf[6] = (uint8_t)((ft_result.red_data_final & 0x0000FF00) >> 8); - databuf[7] = (uint8_t)((ft_result.red_data_final & 0x000000FF) >> 0); - - databuf[8] = (uint8_t)((ft_result.ir_data_final & 0xFF000000) >> 24); - databuf[9] = (uint8_t)((ft_result.ir_data_final & 0x00FF0000) >> 16); - databuf[10] = (uint8_t)((ft_result.ir_data_final & 0x0000FF00) >> 8); - databuf[11] = (uint8_t)((ft_result.ir_data_final & 0x000000FF) >> 0); - - PRINT("%2X %2X %2X %2X %2X %2X %2X %2X %2X %2X %2X %2X\r\n", - databuf[0],databuf[1],databuf[2],databuf[3], - databuf[4],databuf[5],databuf[6],databuf[7], - databuf[8],databuf[9],databuf[10],databuf[11] - ); - - - factorytest_protocol_replymsg(BLE_TEST_CMD_MODE_SOFT_TEST, - BLE_TEST_CMD_SOFT_TEST_SUB_MODE_HRS, - 0x05, - databuf, - 12); - graycard_flag++; -} - -void ble_leaklight_check_timer_callback(void) -{ - if(leaklight_flag == 10) - { - leaklight_flag = 0; - osTimerStop(g_ble_leaklight_timer); - osTimerDelete(g_ble_leaklight_timer); - return; - } - send_ppg_cmd_msg(PPG_SERVICE_CMD_TYPE_DO_LEAKLIGHT_TEST); - FT_RESULTS_t ft_result = hx3695_factroy_test(LEAK_LIGHT_TEST); - send_ppg_cmd_msg(PPG_SERVICE_CMD_TYPE_STOP_PPG_TEST); - uint8_t databuf[12] = {0}; - - databuf[0] = (uint8_t)((ft_result.gr_data_final & 0xFF000000) >> 24); - databuf[1] = (uint8_t)((ft_result.gr_data_final & 0x00FF0000) >> 16); - databuf[2] = (uint8_t)((ft_result.gr_data_final & 0x0000FF00) >> 8); - databuf[3] = (uint8_t)((ft_result.gr_data_final & 0x000000FF) >> 0); - - databuf[4] = (uint8_t)((ft_result.red_data_final & 0xFF000000) >> 24); - databuf[5] = (uint8_t)((ft_result.red_data_final & 0x00FF0000) >> 16); - databuf[6] = (uint8_t)((ft_result.red_data_final & 0x0000FF00) >> 8); - databuf[7] = (uint8_t)((ft_result.red_data_final & 0x000000FF) >> 0); - - databuf[8] = (uint8_t)((ft_result.ir_data_final & 0xFF000000) >> 24); - databuf[9] = (uint8_t)((ft_result.ir_data_final & 0x00FF0000) >> 16); - databuf[10] = (uint8_t)((ft_result.ir_data_final & 0x0000FF00) >> 8); - databuf[11] = (uint8_t)((ft_result.ir_data_final & 0x000000FF) >> 0); - - PRINT("%2X %2X %2X %2X %2X %2X %2X %2X %2X %2X %2X %2X\r\n", - databuf[0],databuf[1],databuf[2],databuf[3], - databuf[4],databuf[5],databuf[6],databuf[7], - databuf[8],databuf[9],databuf[10],databuf[11] - ); - - factorytest_protocol_replymsg(BLE_TEST_CMD_MODE_SOFT_TEST, - BLE_TEST_CMD_SOFT_TEST_SUB_MODE_HRS, - 0x06, - databuf, - 12); - leaklight_flag++; -} - void aging_task(void) { while(aging_t.flag == 0xfdfd0002 && aging_time) @@ -1152,14 +1060,73 @@ void factorytest_protocol_soft_test_decode(uint8_t submode,uint8_t testitem,uint } else if(testitem == 0x05) { //灰卡测试 - g_ble_graycard_timer = osTimerNew((osTimerFunc_t)ble_graycard_check_timer_callback, osTimerPeriodic, NULL, NULL); - osTimerStart(g_ble_graycard_timer,400); + send_ppg_cmd_msg(PPG_SERVICE_CMD_TYPE_DO_GRAYCARD_TEST); + FT_RESULTS_t ft_result = hx3695_factroy_test(GRAY_CARD_TEST); + send_ppg_cmd_msg(PPG_SERVICE_CMD_TYPE_STOP_PPG_TEST); + uint8_t databuf[12] = {0}; + + databuf[0] = (uint8_t)((ft_result.gr_data_final & 0xFF000000) >> 24); + databuf[1] = (uint8_t)((ft_result.gr_data_final & 0x00FF0000) >> 16); + databuf[2] = (uint8_t)((ft_result.gr_data_final & 0x0000FF00) >> 8); + databuf[3] = (uint8_t)((ft_result.gr_data_final & 0x000000FF) >> 0); + + databuf[4] = (uint8_t)((ft_result.red_data_final & 0xFF000000) >> 24); + databuf[5] = (uint8_t)((ft_result.red_data_final & 0x00FF0000) >> 16); + databuf[6] = (uint8_t)((ft_result.red_data_final & 0x0000FF00) >> 8); + databuf[7] = (uint8_t)((ft_result.red_data_final & 0x000000FF) >> 0); + + databuf[8] = (uint8_t)((ft_result.ir_data_final & 0xFF000000) >> 24); + databuf[9] = (uint8_t)((ft_result.ir_data_final & 0x00FF0000) >> 16); + databuf[10] = (uint8_t)((ft_result.ir_data_final & 0x0000FF00) >> 8); + databuf[11] = (uint8_t)((ft_result.ir_data_final & 0x000000FF) >> 0); + + PRINT("%2X %2X %2X %2X %2X %2X %2X %2X %2X %2X %2X %2X\r\n", + databuf[0],databuf[1],databuf[2],databuf[3], + databuf[4],databuf[5],databuf[6],databuf[7], + databuf[8],databuf[9],databuf[10],databuf[11] + ); + + + factorytest_protocol_replymsg(BLE_TEST_CMD_MODE_SOFT_TEST, + BLE_TEST_CMD_SOFT_TEST_SUB_MODE_HRS, + 0x05, + databuf, + 12); } else if(testitem == 0x06) { //漏光测试 - g_ble_leaklight_timer = osTimerNew((osTimerFunc_t)ble_leaklight_check_timer_callback, osTimerPeriodic, NULL, NULL); - osTimerStart(g_ble_leaklight_timer,400); + send_ppg_cmd_msg(PPG_SERVICE_CMD_TYPE_DO_LEAKLIGHT_TEST); + FT_RESULTS_t ft_result = hx3695_factroy_test(LEAK_LIGHT_TEST); + send_ppg_cmd_msg(PPG_SERVICE_CMD_TYPE_STOP_PPG_TEST); + uint8_t databuf[12] = {0}; + + databuf[0] = (uint8_t)((ft_result.gr_data_final & 0xFF000000) >> 24); + databuf[1] = (uint8_t)((ft_result.gr_data_final & 0x00FF0000) >> 16); + databuf[2] = (uint8_t)((ft_result.gr_data_final & 0x0000FF00) >> 8); + databuf[3] = (uint8_t)((ft_result.gr_data_final & 0x000000FF) >> 0); + + databuf[4] = (uint8_t)((ft_result.red_data_final & 0xFF000000) >> 24); + databuf[5] = (uint8_t)((ft_result.red_data_final & 0x00FF0000) >> 16); + databuf[6] = (uint8_t)((ft_result.red_data_final & 0x0000FF00) >> 8); + databuf[7] = (uint8_t)((ft_result.red_data_final & 0x000000FF) >> 0); + + databuf[8] = (uint8_t)((ft_result.ir_data_final & 0xFF000000) >> 24); + databuf[9] = (uint8_t)((ft_result.ir_data_final & 0x00FF0000) >> 16); + databuf[10] = (uint8_t)((ft_result.ir_data_final & 0x0000FF00) >> 8); + databuf[11] = (uint8_t)((ft_result.ir_data_final & 0x000000FF) >> 0); + + PRINT("%2X %2X %2X %2X %2X %2X %2X %2X %2X %2X %2X %2X\r\n", + databuf[0],databuf[1],databuf[2],databuf[3], + databuf[4],databuf[5],databuf[6],databuf[7], + databuf[8],databuf[9],databuf[10],databuf[11] + ); + + factorytest_protocol_replymsg(BLE_TEST_CMD_MODE_SOFT_TEST, + BLE_TEST_CMD_SOFT_TEST_SUB_MODE_HRS, + 0x06, + databuf, + 12); } break; diff --git a/code/sdk/drivers/peripheral/mag/mmc5603/mmc5603_main.c b/code/sdk/drivers/peripheral/mag/mmc5603/mmc5603_main.c index 3a3751a98..d0b3fed0a 100644 --- a/code/sdk/drivers/peripheral/mag/mmc5603/mmc5603_main.c +++ b/code/sdk/drivers/peripheral/mag/mmc5603/mmc5603_main.c @@ -436,7 +436,7 @@ int mag_service_get_iAccuracy(void) int mmc5603_stop(void) { - SavePara_infile(saveData,4); + SavePara_infile(g_MagPara,4); MMC5603_Disable(); return 0; } diff --git a/code/sdk/drivers/peripheral/mag/service/mag_service.c b/code/sdk/drivers/peripheral/mag/service/mag_service.c index 23ed1d94a..ca426e336 100644 --- a/code/sdk/drivers/peripheral/mag/service/mag_service.c +++ b/code/sdk/drivers/peripheral/mag/service/mag_service.c @@ -184,6 +184,8 @@ void create_mag_queue(void) MMC_ERROR("[mag][service] app create mail fail\n"); } } + +#define MAG_BOARD_TASK_SIZE 0x900 errcode_t uapi_mag_service_init(void) { @@ -205,7 +207,7 @@ errcode_t uapi_mag_service_init(void) taskcfg.create_queue_handle = create_mag_queue; taskcfg.attr.name="mag_service"; taskcfg.attr.priority = TASK_PRIORITY_APP; - taskcfg.attr.stack_size = APP_BOARD_TASK_SIZE; + taskcfg.attr.stack_size = MAG_BOARD_TASK_SIZE; taskcfg.func = mag_service_check_task; taskcfg.use_mem = USE_EXTEND_MEM; -- 2.17.1