From 5577f54506d74d72f9ac7c60e8670b9c06553c12 Mon Sep 17 00:00:00 2001 From: =?utf8?q?=E5=BD=AD=E7=A3=8A?= <1624952103@qq.com> Date: Tue, 19 Nov 2024 12:00:50 +0000 Subject: [PATCH] Merge #1426 into sdk602patch0911 from refs/changes/1426/head MIME-Version: 1.0 Content-Type: text/plain; charset=utf8 Content-Transfer-Encoding: 8bit 调整心率活体检测阈值,改善睡眠出睡误判情况,暂时去除音频回声测试改为普通录音播放测试,优化UI产测,加快滑动速度 * refs/changes/1426/head: (1 commits squashed) - 调整心率活体检测阈值,改善睡眠出睡误判情况,暂时去除音频回声测试改为普通录音播放测试,优化UI产测,加快滑动速度 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: snickersun@163.com CR-link: https://codeup.aliyun.com/64191456b9581d62e8f81ac0/FD230/change/1426 --- .../battery/service/battery_driver.cpp | 3 + .../battery/service/battery_service.cpp | 4 +- .../nativeui/heartrate/src/HeartModel.cpp | 22 ++- .../producttest/include/testmicrophone.h | 8 +- .../producttest/include/testmicrophoneC.h | 1 + .../nativeui/producttest/include/testold.h | 5 +- .../producttest/src/testPresenter.cpp | 10 ++ .../nativeui/producttest/src/testView.cpp | 3 + .../producttest/src/testmicrophone.cpp | 135 +++++++++++++----- .../nativeui/producttest/src/testold.cpp | 25 ++++ .../factorytest_protocol.c | 71 ++++----- .../drivers/peripheral/cywee/src/main_dml.c | 1 + .../drivers/peripheral/ppg/hx3695/hx3695.c | 17 +-- .../peripheral/ppg/hx3695/hx3695_hal.c | 4 +- .../drivers/peripheral/utils/custom_utils.c | 7 + .../drivers/peripheral/utils/custom_utils.h | 1 + 16 files changed, 222 insertions(+), 95 deletions(-) diff --git a/code/sdk/application/battery/service/battery_driver.cpp b/code/sdk/application/battery/service/battery_driver.cpp index b5043e76d..abe74488f 100644 --- a/code/sdk/application/battery/service/battery_driver.cpp +++ b/code/sdk/application/battery/service/battery_driver.cpp @@ -789,6 +789,9 @@ uint8_t batteryservice_get_battery_temp(float *temp) uint8_t batteryservice_get_pcb_temp(float *temp) { battery_info_t *current_battery_info = get_current_battery_info(); + batteryservice_get_voltage_by_channel(¤t_battery_info->pcb_ntc_temp,ADC_CHANNEL_PCB_TEMP); + uapi_tcxo_delay_ms(20); + // battery_info_t *current_battery_info = get_current_battery_info(); *temp = current_battery_info->pcb_ntc_temp; return 0; } diff --git a/code/sdk/application/battery/service/battery_service.cpp b/code/sdk/application/battery/service/battery_service.cpp index 0cf34f75e..22c77742d 100644 --- a/code/sdk/application/battery/service/battery_service.cpp +++ b/code/sdk/application/battery/service/battery_service.cpp @@ -232,8 +232,8 @@ static void battery_check_voltage(void) uapi_tcxo_delay_ms(20); batteryservice_get_voltage_by_channel(¤t_battery_info->battery_ntc_temp,ADC_CHANNEL_BAT_TEMP); uapi_tcxo_delay_ms(20); - batteryservice_get_voltage_by_channel(¤t_battery_info->pcb_ntc_temp,ADC_CHANNEL_PCB_TEMP); - uapi_tcxo_delay_ms(20); + // batteryservice_get_voltage_by_channel(¤t_battery_info->pcb_ntc_temp,ADC_CHANNEL_PCB_TEMP); + // uapi_tcxo_delay_ms(20); } static int g_chargestatus =0; diff --git a/code/sdk/application/wearable/fd230app/nativeui/heartrate/src/HeartModel.cpp b/code/sdk/application/wearable/fd230app/nativeui/heartrate/src/HeartModel.cpp index 8f55cea69..2866700c3 100644 --- a/code/sdk/application/wearable/fd230app/nativeui/heartrate/src/HeartModel.cpp +++ b/code/sdk/application/wearable/fd230app/nativeui/heartrate/src/HeartModel.cpp @@ -391,6 +391,21 @@ void HeartModel::Heart_Control(HeartState state, HeartCheck check) { return; } + checkstate = check; + //被动 + if (checkstate == HeartCheck::PASSIVITY) { + uapi_dev_runtime_set_hrs_passivity(1); + WEARABLE_LOGD(WEARABLE_LOG_MODULE_APP, + "uapi_dev_runtime_set_hrs_passivity(1)"); + } + else + { + uapi_dev_runtime_set_hrs_passivity(0); + WEARABLE_LOGE(WEARABLE_LOG_MODULE_APP, + "uapi_dev_runtime_set_hrs_passivity(0)"); + } + + if (state == HeartState::End && heartstate == true) { WEARABLE_LOGD(WEARABLE_LOG_MODULE_APP, "HeartState End"); //状态数全部清空 @@ -419,13 +434,6 @@ void HeartModel::Heart_Control(HeartState state, HeartCheck check) { uint8_t md = PPG_SERVICE_CMD_TYPE_DO_PPG_TEST; send_ppg_cmd_msg(md); heartstate = true; - checkstate = check; - //被动 - if (checkstate == HeartCheck::PASSIVITY) { - uapi_dev_runtime_set_hrs_passivity(1); - WEARABLE_LOGD(WEARABLE_LOG_MODULE_APP, - "uapi_dev_runtime_set_hrs_passivity(1)"); - } } } // 开始检测 diff --git a/code/sdk/application/wearable/fd230app/nativeui/producttest/include/testmicrophone.h b/code/sdk/application/wearable/fd230app/nativeui/producttest/include/testmicrophone.h index 0af074d53..58a73b024 100644 --- a/code/sdk/application/wearable/fd230app/nativeui/producttest/include/testmicrophone.h +++ b/code/sdk/application/wearable/fd230app/nativeui/producttest/include/testmicrophone.h @@ -2,7 +2,7 @@ * @Author: penglei 1624952103@qq.com * @Date: 2024-08-23 10:50:37 * @LastEditors: penglei 1624952103@qq.com - * @LastEditTime: 2024-09-07 18:04:07 + * @LastEditTime: 2024-11-19 16:16:46 * @FilePath: /FD230/code/sdk/application/wearable/fd230app/nativeui/producttest/include/testmicrophone.h * @Description: * @@ -23,6 +23,8 @@ #include "record/include/RecordingModel.h" //#include "cmsis_os.h" #include + +// #define AUDIO_ECHO_TEST namespace OHOS { class testmicrohoneView @@ -59,7 +61,11 @@ namespace OHOS bool testphoneScrollViewcrollViewinit(uint8_t); UIScrollView *testmakephoneScrollView{nullptr}; UILabelButtonExt* labelButton_next = nullptr; +#ifdef AUDIO_ECHO_TEST UILabelButtonExt* button[2]{NULL}; +#else + UILabelButtonExt* button{NULL}; +#endif bool initViewStatus{false}; UILabel *Title{nullptr}; // 标题 }; diff --git a/code/sdk/application/wearable/fd230app/nativeui/producttest/include/testmicrophoneC.h b/code/sdk/application/wearable/fd230app/nativeui/producttest/include/testmicrophoneC.h index 81c4cc03f..3e80a34e5 100644 --- a/code/sdk/application/wearable/fd230app/nativeui/producttest/include/testmicrophoneC.h +++ b/code/sdk/application/wearable/fd230app/nativeui/producttest/include/testmicrophoneC.h @@ -19,6 +19,7 @@ extern "C" #endif int32_t microhone_switch(bool isopen); void check_spk(bool isopen); + void check_mic(bool isopen); #ifdef __cplusplus #if __cplusplus } diff --git a/code/sdk/application/wearable/fd230app/nativeui/producttest/include/testold.h b/code/sdk/application/wearable/fd230app/nativeui/producttest/include/testold.h index 630ee6104..4e35215a2 100644 --- a/code/sdk/application/wearable/fd230app/nativeui/producttest/include/testold.h +++ b/code/sdk/application/wearable/fd230app/nativeui/producttest/include/testold.h @@ -2,7 +2,7 @@ * @Author: penglei 1624952103@qq.com * @Date: 2024-09-18 17:17:23 * @LastEditors: penglei 1624952103@qq.com - * @LastEditTime: 2024-11-14 11:30:28 + * @LastEditTime: 2024-11-18 21:51:50 * @FilePath: /FD230/code/sdk/application/wearable/fd230app/nativeui/producttest/include/testold.h * @Description: 这是默认设置,请设置`customMade`, 打开koroFileHeader查看配置 进行设置: https://github.com/OBKoro1/koro1FileHeader/wiki/%E9%85%8D%E7%BD%AE */ @@ -74,6 +74,9 @@ namespace OHOS UILabelButtonExt* labelButton_exit = nullptr; UILabelButtonExt* labelButton_start = nullptr; UILabelButtonExt* labelButton_stop = nullptr; + UILabelButtonExt* labelButton_deep = nullptr; + UILabelButtonExt* labelButton_shut = nullptr; + UILabel *label_flag{nullptr}; UILabel *label_target_time{nullptr}; diff --git a/code/sdk/application/wearable/fd230app/nativeui/producttest/src/testPresenter.cpp b/code/sdk/application/wearable/fd230app/nativeui/producttest/src/testPresenter.cpp index efdc8e26c..81fff9225 100644 --- a/code/sdk/application/wearable/fd230app/nativeui/producttest/src/testPresenter.cpp +++ b/code/sdk/application/wearable/fd230app/nativeui/producttest/src/testPresenter.cpp @@ -281,6 +281,16 @@ namespace OHOS { NativeAbility::GetInstance().ChangeSlice(VIEW_TEST); } + if(strcmp(view.GetViewId(),"deep") == 0) + { + do_cywee_service_check_msg(CYWEE_SERVICE_CMD_STOP_ACC,NULL); + stop_custom_ble_service(); + LOS_Msleep(50); + uapi_set4GCapability(false); + LOS_Msleep(50); + mcu_pm_lcd_off(NULL,NULL); + return true; + } #ifdef SUPPORT_A5133_SERVICE if(strcmp(view.GetViewId(),"receive") == 0) { diff --git a/code/sdk/application/wearable/fd230app/nativeui/producttest/src/testView.cpp b/code/sdk/application/wearable/fd230app/nativeui/producttest/src/testView.cpp index 6b8e40afa..9ad47743f 100644 --- a/code/sdk/application/wearable/fd230app/nativeui/producttest/src/testView.cpp +++ b/code/sdk/application/wearable/fd230app/nativeui/producttest/src/testView.cpp @@ -195,6 +195,9 @@ namespace OHOS SystemScrollView[TESTVIEW]->SetScrollBlankSize(35); SystemScrollView[TESTVIEW]->SetReboundSize(50); SystemScrollView[TESTVIEW]->SetDirection(1); + SystemScrollView[TESTVIEW]->SetThrowDrag(true); // 设置手指抬起屏幕后是否继续滚动。 + SystemScrollView[TESTVIEW]->SetMaxScrollDistance(1000); // 设置手指抬起屏幕后的最大滚动距离。 + SystemScrollView[TESTVIEW]->SetSwipeACCLevel(200); /*设置手指抬起屏幕后的补偿距离。*/ //UIView::OnDragListener *draglistener = static_cast(new SystemViewOnDragListener()); // if (draglistener == nullptr) // { diff --git a/code/sdk/application/wearable/fd230app/nativeui/producttest/src/testmicrophone.cpp b/code/sdk/application/wearable/fd230app/nativeui/producttest/src/testmicrophone.cpp index e94213556..346dd1c1c 100644 --- a/code/sdk/application/wearable/fd230app/nativeui/producttest/src/testmicrophone.cpp +++ b/code/sdk/application/wearable/fd230app/nativeui/producttest/src/testmicrophone.cpp @@ -52,6 +52,8 @@ namespace OHOS { testmakephoneScrollView->RemoveAll(); +#ifdef AUDIO_ECHO_TEST + if(button[0]!=NULL) { delete button[0]; @@ -62,6 +64,15 @@ namespace OHOS delete button[1]; button[1]=nullptr; } + +#else + if(button!=NULL) + { + delete button; + button=nullptr; + } +#endif + if(labelButton_next) { delete labelButton_next; @@ -121,21 +132,30 @@ namespace OHOS static char *Path= "/user/userdata/microphone.mp3"; void testmicrohoneView::buttoncallback() { +#ifdef AUDIO_ECHO_TEST if(button[0]!=NULL) +#else + if(button !=NULL) +#endif { errcode_t ret = 0; if(makphone_falg==0) { - // char *args[6] = {0}; - // const char *defaultArgs[6] = {"01", "mp3", "16000", "1", "16","/user/userdata/microphone.mp3"}; // 默认参数数组 - - // for (int i = 0; i < 6; ++i) - // { - // args[i] = (char *)malloc(64); - // sprintf(args[i], "%s", defaultArgs[i]); - // } - // /* ---------------------------------- 开始录音 ---------------------------------- */ - // AudioCaptureSample(6, (const char **)args); +#ifndef AUDIO_ECHO_TEST + uapi_delete_files("/user/userdata/microphone.mp3"); + char *args[6] = {0}; + const char *defaultArgs[6] = {"01", "mp3", "16000", "1", "16","/user/userdata/microphone.mp3"}; // 默认参数数组 + + for (int i = 0; i < 6; ++i) + { + args[i] = (char *)malloc(64); + sprintf(args[i], "%s", defaultArgs[i]); + } + /* ---------------------------------- 开始录音 ---------------------------------- */ + WEARABLE_LOGE(WEARABLE_LOG_MODULE_APP, " AudioCaptureSample(6, (const char **)args); "); + AudioCaptureSample(6, (const char **)args); + button->SetText("stop mic"); +#else ret = uapi_start_audio_test(volume); if(ret != ERRCODE_SUCC) { @@ -143,39 +163,45 @@ namespace OHOS uapi_stop_audio_test(); } else - { button[0]->SetText("stop"); - makphone_falg = 1; - } - +#endif + makphone_falg = 1; } else if(makphone_falg==1) { - // int32_t argc = 1; - // uint8_t *argv = (uint8_t*)"stop"; - // AudioCaptureSample(argc, (const char **)&argv); - // button[0]->SetText("play"); - // makphone_falg++; - - // FILE *file =fopen("/user/userdata/microphone.mp3","rb"); - // if(file==NULL) - // { - // WEARABLE_LOGE(WEARABLE_LOG_MODULE_APP, "ffffffffffffffffsssssss"); - // } - // fclose(file); +#ifndef AUDIO_ECHO_TEST + int32_t argc = 1; + uint8_t *argv = (uint8_t*)"stop"; + AudioCaptureSample(argc, (const char **)&argv); + button->SetText("play mic"); + makphone_falg = 2; + + FILE *file =fopen("/user/userdata/microphone.mp3","rb"); + if(file==NULL) + { + WEARABLE_LOGE(WEARABLE_LOG_MODULE_APP, "ffffffffffffffffsssssss"); + } + fclose(file); +#else uapi_stop_audio_test(); button[0]->SetText("start"); makphone_falg = 0; +#endif + } +#ifndef AUDIO_ECHO_TEST + else if(makphone_falg==2) + { + button->SetText("stop play"); + FindWatchViewEventListener::GetInstance().PopInterPlayMusic(Path); + makphone_falg = 3; + } + else if(makphone_falg==3) + { + button->SetText("start mic"); + FindWatchViewEventListener::GetInstance().PopInterCancelMusic(); + makphone_falg = 0; } - // else if(makphone_falg==2) - // { - - // AlarmClockModel::GetInstance()->testPlayerStart(Path); - - // } - - - +#endif } RootView::GetInstance()->Invalidate(); @@ -207,7 +233,7 @@ namespace OHOS testmakephoneScrollView->SetStyle(STYLE_BORDER_COLOR, Color::Yellow().blue); - +#ifdef AUDIO_ECHO_TEST /* -------------------------------------------------------------------------- */ ButtonConfig_ext_t buttonconfig; buttonconfig.x = 200; @@ -218,7 +244,7 @@ namespace OHOS buttonconfig.label_y=0; buttonconfig.Fontsize=30; buttonconfig.ViewId="testmicrohoneView"; - buttonconfig.str="statr"; + buttonconfig.str="start"; buttonconfig.ALIGN=TEXT_ALIGNMENT_LEFT; button[0]=SetTheButton_ext(buttonconfig); testmakephoneScrollView->Add(button[0]); @@ -237,6 +263,24 @@ namespace OHOS button[1]=SetTheButton_ext(buttonconfig); testmakephoneScrollView->Add(button[1]); +#else + + ButtonConfig_ext_t buttonconfig; + buttonconfig.x = 200; + buttonconfig.y = 100; + buttonconfig.w = 250; + buttonconfig.h = 116; + buttonconfig.label_x=40; + buttonconfig.label_y=0; + buttonconfig.Fontsize=30; + buttonconfig.ViewId="testmicrohoneView"; + buttonconfig.str="start mic"; + buttonconfig.ALIGN=TEXT_ALIGNMENT_LEFT; + button=SetTheButton_ext(buttonconfig); + testmakephoneScrollView->Add(button); + makphone_falg=0; +#endif + UIView::OnDragListener *draglistener = static_cast(testPresenter::GetInstance()); if (draglistener == nullptr) { @@ -324,6 +368,23 @@ extern "C" } + void check_mic(bool isopen) + { + if(isopen) + { + // AlarmClockModel::GetInstance()->testPlayerStart("/user/userdata/microphone.mp3"); + FindWatchViewEventListener::GetInstance().PopInterPlayMusic("/user/userdata/microphone.mp3"); + // AlarmClockModel::GetInstance()->AlarmPlayerStart(); + } + else + { + // AlarmClockModel::GetInstance()->AlarmPlayerStop(); + FindWatchViewEventListener::GetInstance().PopInterCancelMusic(); + // AlarmClockModel::GetInstance()->AlarmPlayerStop(); + } + + } + #ifdef __cplusplus #if __cplusplus } diff --git a/code/sdk/application/wearable/fd230app/nativeui/producttest/src/testold.cpp b/code/sdk/application/wearable/fd230app/nativeui/producttest/src/testold.cpp index 6b268cab9..f312e1c9c 100644 --- a/code/sdk/application/wearable/fd230app/nativeui/producttest/src/testold.cpp +++ b/code/sdk/application/wearable/fd230app/nativeui/producttest/src/testold.cpp @@ -64,6 +64,19 @@ namespace OHOS g_aging_timer = NULL; } + + + if(labelButton_shut) + { + delete labelButton_shut; + labelButton_shut=nullptr; + } + + if(labelButton_deep) + { + delete labelButton_deep; + labelButton_deep=nullptr; + } if(labelButton_exit) @@ -530,6 +543,18 @@ namespace OHOS } testoldScrollView->Add(label_charge_error); + + + labelButton_shut= testAboutView::GetInstance()->init_button_next(300,500,Test_ViewMapper_t[id].viewid_str_next); + labelButton_shut->SetText("shut"); + labelButton_shut->SetViewId("shut"); + testoldScrollView->Add(labelButton_shut); + + labelButton_deep= testAboutView::GetInstance()->init_button_next(300,400,Test_ViewMapper_t[id].viewid_str_next); + labelButton_deep->SetText("deep"); + labelButton_deep->SetViewId("deep"); + testoldScrollView->Add(labelButton_deep); + labelButton_exit= testAboutView::GetInstance()->init_button_next(300,300,Test_ViewMapper_t[id].viewid_str_next); labelButton_exit->SetText("exit"); labelButton_exit->SetViewId("exit"); 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 4f71ef184..39ee44cf7 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-14 16:27:45 + * @LastEditTime: 2024-11-19 17:06:28 * @FilePath: /FD230/code/sdk/application/wearable/service/factorytest_service/factorytest_protocol.c * @Description: * @@ -1894,7 +1894,8 @@ void factorytest_protocol_soft_test_decode(uint8_t submode,uint8_t testitem,uint { //开始录音 uint8_t send_data= 0; - uapi_start_audio_test(30); + // uapi_start_audio_test(30); + uapi_microhone_switch(1); factorytest_protocol_replymsg(BLE_TEST_CMD_MODE_SOFT_TEST, BLE_TEST_CMD_SOFT_TEST_SUB_MODE_SPEAKER, 0x01, @@ -1905,14 +1906,46 @@ void factorytest_protocol_soft_test_decode(uint8_t submode,uint8_t testitem,uint { //停止录音 uint8_t send_data= 0; - uapi_stop_audio_test(); + // uapi_stop_audio_test(); + uapi_microhone_switch(0); factorytest_protocol_replymsg(BLE_TEST_CMD_MODE_SOFT_TEST, BLE_TEST_CMD_SOFT_TEST_SUB_MODE_SPEAKER, 0x02, &send_data, 1); } - if (testitem == 0x03) + else if(testitem == 0x03) + { + //播放录音 + uint8_t send_data= 0; + uapi_check_mic(1); + factorytest_protocol_replymsg(BLE_TEST_CMD_MODE_SOFT_TEST, + BLE_TEST_CMD_SOFT_TEST_SUB_MODE_SPEAKER, + 0x03, + &send_data, + 1); + } else if(testitem == 0x04) + { + //停止播放 + uint8_t send_data= 0; + uapi_check_mic(0); + factorytest_protocol_replymsg(BLE_TEST_CMD_MODE_SOFT_TEST, + BLE_TEST_CMD_SOFT_TEST_SUB_MODE_SPEAKER, + 0x04, + &send_data, + 1); + } else if(testitem == 0x05) + { + //删除录音 + uint8_t send_data = uapi_delete_files("/user/userdata/microphone.mp3"); + factorytest_protocol_replymsg(BLE_TEST_CMD_MODE_SOFT_TEST, + BLE_TEST_CMD_SOFT_TEST_SUB_MODE_SPEAKER, + 0x05, + &send_data, + 1); + } + + if (testitem == 0x06) { uint8_t send_data = 0x00; uapi_hfp_connect_(); @@ -1925,36 +1958,6 @@ void factorytest_protocol_soft_test_decode(uint8_t submode,uint8_t testitem,uint 1); } - //else if(testitem == 0x03) - // { - // //播放录音 - // uint8_t send_data= 0; - // uapi_check_spk(1); - // factorytest_protocol_replymsg(BLE_TEST_CMD_MODE_SOFT_TEST, - // BLE_TEST_CMD_SOFT_TEST_SUB_MODE_SPEAKER, - // 0x03, - // &send_data, - // 1); - // } else if(testitem == 0x04) - // { - // //停止播放 - // uint8_t send_data= 0; - // uapi_check_spk(0); - // factorytest_protocol_replymsg(BLE_TEST_CMD_MODE_SOFT_TEST, - // BLE_TEST_CMD_SOFT_TEST_SUB_MODE_SPEAKER, - // 0x04, - // &send_data, - // 1); - // } else if(testitem == 0x05) - // { - // //删除录音 - // uint8_t send_data = uapi_delete_files("/user/userdata/microphone.mp3"); - // factorytest_protocol_replymsg(BLE_TEST_CMD_MODE_SOFT_TEST, - // BLE_TEST_CMD_SOFT_TEST_SUB_MODE_SPEAKER, - // 0x05, - // &send_data, - // 1); - //} break; default: diff --git a/code/sdk/drivers/peripheral/cywee/src/main_dml.c b/code/sdk/drivers/peripheral/cywee/src/main_dml.c index 746bf2325..bf918790b 100644 --- a/code/sdk/drivers/peripheral/cywee/src/main_dml.c +++ b/code/sdk/drivers/peripheral/cywee/src/main_dml.c @@ -891,6 +891,7 @@ void cywee_inactivity_mode_change(int mode) //设置睡眠 memset(&scl, 0, sizeof(scl)); scl.iData[0] = 1; + scl.iData[1] = 30; //优化睡眠误判出睡情况 scl.iData[3] = 4; scl.iData[4] = 4; scl.iData[6] = 4; diff --git a/code/sdk/drivers/peripheral/ppg/hx3695/hx3695.c b/code/sdk/drivers/peripheral/ppg/hx3695/hx3695.c index 8ab53309f..71a0068a3 100644 --- a/code/sdk/drivers/peripheral/ppg/hx3695/hx3695.c +++ b/code/sdk/drivers/peripheral/ppg/hx3695/hx3695.c @@ -96,9 +96,9 @@ const uint8_t hx3695_hrs_g3_agc_idac = HR_GREEN3_AGC_OFFSET; //hrv agc const uint8_t hx3695_hrv_agc_idac = HR_GREEN_AGC_OFFSET; -const uint8_t green_led_max_init = 128; +const uint8_t green_led_max_init = 255; const uint8_t red_led_max_init = 255; -const uint8_t ir_led_max_init = 128; +const uint8_t ir_led_max_init = 255; uint8_t low_vbat_flag =0; WORK_MODE_T work_mode_flag = HRS_MODE; @@ -2254,7 +2254,7 @@ bool hx3695_init(WORK_MODE_T mode) case HRS_MODE: //TYHX_LOG(" hx3695_init mode : HRS_MODE \n"); #ifdef HRS_ALG_LIB - tyhx_hrs_set_living(1, 10, 30); + tyhx_hrs_set_living(1, 20, 30); if(hx3695_hrs_enable()== SENSOR_OP_FAILED) { return false; @@ -3777,15 +3777,8 @@ void hx3695_wear_ppg_Int_handle(void) hx3695_wear_msg_code_t hx3695_wear_status; hx3695_check_touch_read(&ppg_s_data); - hx3695_wear_status = hx3695_check_touch_send_data(ir_buf,*count); - // PRINT("hx3695_wear_status : %d \r\n",hx3695_wear_status); - if(history_wear_status != hx3695_wear_status) - { - history_wear_status = hx3695_wear_status; - cywee_data = history_wear_status; - do_cywee_service_check_msg(CYWEE_SERVICE_CMD_WEAR_STATUS_CHANGE,&cywee_data); - } - + cywee_wear_status = hx3695_check_touch_send_data(ir_buf,*count); + hx3695_wearstatus_update(); extern uint8_t notouch_cnt; extern uint8_t touch_cnt; diff --git a/code/sdk/drivers/peripheral/ppg/hx3695/hx3695_hal.c b/code/sdk/drivers/peripheral/ppg/hx3695/hx3695_hal.c index 82d728413..4bad4134c 100644 --- a/code/sdk/drivers/peripheral/ppg/hx3695/hx3695_hal.c +++ b/code/sdk/drivers/peripheral/ppg/hx3695/hx3695_hal.c @@ -2,7 +2,7 @@ * @Author: penglei 1624952103@qq.com * @Date: 2024-03-13 15:08:38 * @LastEditors: penglei 1624952103@qq.com - * @LastEditTime: 2024-11-18 18:04:37 + * @LastEditTime: 2024-11-19 19:40:35 * @FilePath: /FD230/code/sdk/drivers/peripheral/ppg/hx3695/hx3695_hal.c * @Description: * @@ -76,6 +76,8 @@ void ppg_send_cmd_to_driver(char* mode, uint8_t enable) { #ifdef HRS_ALG_LIB hx3695_hrs_disable(); + // PRINT("uapi_dev_runtime_get_sleep_monitoring_status : %d \n",uapi_dev_runtime_get_sleep_monitoring_status()); + // PRINT("uapi_dev_runtime_get_hrs_passivity_flag : %d \n",uapi_dev_runtime_get_hrs_passivity_flag()); if(uapi_dev_runtime_get_sleep_monitoring_status() && uapi_dev_runtime_get_hrs_passivity_flag())//处于睡眠监测 且在心率周期检测期间 上报活体佩戴 { hx3695_wearstatus_update(); diff --git a/code/sdk/drivers/peripheral/utils/custom_utils.c b/code/sdk/drivers/peripheral/utils/custom_utils.c index 7d2ae55bd..372093009 100644 --- a/code/sdk/drivers/peripheral/utils/custom_utils.c +++ b/code/sdk/drivers/peripheral/utils/custom_utils.c @@ -2761,6 +2761,13 @@ void uapi_check_spk(bool isopen) #endif } +void uapi_check_mic(bool isopen) +{ + #ifdef FD230 + check_mic(isopen); + #endif +} + void uapi_factorytest_set_lcd_color(int color) { #ifdef FD230 diff --git a/code/sdk/drivers/peripheral/utils/custom_utils.h b/code/sdk/drivers/peripheral/utils/custom_utils.h index 1bfa2acc8..86769229a 100644 --- a/code/sdk/drivers/peripheral/utils/custom_utils.h +++ b/code/sdk/drivers/peripheral/utils/custom_utils.h @@ -326,6 +326,7 @@ void uapi_ppg_get_id(uint8_t *chip_id); int32_t uapi_microhone_switch(bool isopen); void uapi_check_spk(bool isopen); +void uapi_check_mic(bool isopen); void uapi_factorytest_set_lcd_color(int color); void uapi_factorytest_enter_test_view(int cmd); void uapi_factorytest_enter_test_tp_view(void); -- 2.17.1