From 4192d9df2ce4d7322082f47a7707c6c667681920 Mon Sep 17 00:00:00 2001 From: penglei <1624952103@qq.com> Date: Thu, 5 Sep 2024 19:07:02 +0800 Subject: [PATCH] =?utf8?q?=E4=BC=98=E5=8C=96=E4=BD=A9=E6=88=B4=E6=A3=80?= =?utf8?q?=E6=B5=8B:=E5=B0=8F=E7=9D=A1=E6=A8=A1=E5=BC=8F=E5=BC=80=E5=90=AF?= =?utf8?q?=E7=BA=AF=E4=BD=A9=E6=88=B4=20=E7=9D=A1=E7=9C=A0=E6=A8=A1?= =?utf8?q?=E5=BC=8F=E5=BC=80=E5=90=AF=E6=B4=BB=E4=BD=93=E4=BD=A9=E6=88=B4?= =?utf8?q?=20=E3=80=82=20=E7=BA=AF=E4=BD=A9=E6=88=B4=E6=A3=80=E6=B5=8BTime?= =?utf8?q?r=E4=BF=AE=E6=94=B9=E4=B8=BA5=E5=88=86=E9=92=9F=E3=80=82?= MIME-Version: 1.0 Content-Type: text/plain; charset=utf8 Content-Transfer-Encoding: 8bit --- .../src/AlarmClockTimerConfig.cpp | 3 +++ code/sdk/drivers/peripheral/ppg/hx3695/hx3695.c | 11 +++++++---- .../drivers/peripheral/ppg/hx3695/tyhx_hrs_custom.h | 5 +++-- 3 files changed, 13 insertions(+), 6 deletions(-) diff --git a/code/sdk/application/wearable/fd230app/nativeui/alarmclocktimerconfig/src/AlarmClockTimerConfig.cpp b/code/sdk/application/wearable/fd230app/nativeui/alarmclocktimerconfig/src/AlarmClockTimerConfig.cpp index 73056b053..5523af3d2 100644 --- a/code/sdk/application/wearable/fd230app/nativeui/alarmclocktimerconfig/src/AlarmClockTimerConfig.cpp +++ b/code/sdk/application/wearable/fd230app/nativeui/alarmclocktimerconfig/src/AlarmClockTimerConfig.cpp @@ -36,6 +36,7 @@ #include "AppViewIDs.h" #include "player/include/PlayersView.h" #include "record/include/RecordingPlayerView.h" +#include "ppg_service.h" #ifdef __cplusplus extern "C" @@ -434,6 +435,7 @@ extern "C" uapi_dev_runtime_set_nap_monitoring_status(1); uapi_dev_runtime_set_sleep_monitoring_status(0); OHOS::SleepModel::GetInstance().ReInitData(); // 更新睡眠数据 + set_keep_in_wear_det_mode(1); //开启小睡佩戴监测 SendMsgToUIService(UI_UPDATE_SLEEP_DATA, 0, nullptr, 0); do_cywee_service_check_msg(CYWEE_SERVICE_CMD_NAP_SEDENTARY_MODE, NULL); // 算法底层切换小睡监测模式 } @@ -446,6 +448,7 @@ extern "C" OHOS::clean_sleep_data(); // 清零睡眠文件存储数据 uapi_dev_runtime_set_sleep_monitoring_status(1); uapi_dev_runtime_set_nap_monitoring_status(0); + set_keep_in_wear_det_mode(0); //关闭小睡佩戴监测 do_cywee_service_check_msg(CYWEE_SERVICE_CMD_GET_SLEEP_DATA, NULL); // 强制获取小睡数据,结束小睡 // 睡眠弹窗 WEARABLE_LOGE(WEARABLE_LOG_MODULE_APP, "要睡觉啦!"); diff --git a/code/sdk/drivers/peripheral/ppg/hx3695/hx3695.c b/code/sdk/drivers/peripheral/ppg/hx3695/hx3695.c index 67484b953..79975e118 100644 --- a/code/sdk/drivers/peripheral/ppg/hx3695/hx3695.c +++ b/code/sdk/drivers/peripheral/ppg/hx3695/hx3695.c @@ -2720,11 +2720,14 @@ static void get_avg_hrs(int32_t hrs) void hx3695_wearstatus_update(void) { - if(wear_status != hrsresult.wearstatus) + if(uapi_dev_runtime_get_sleep_monitoring_status())//处于睡眠监测 上报活体佩戴 { - wear_status = hrsresult.wearstatus; - cywee_data = wear_status; - do_cywee_service_check_msg(CYWEE_SERVICE_CMD_WEAR_STATUS_CHANGE,&cywee_data); + if(wear_status != hrsresult.wearstatus) + { + wear_status = hrsresult.wearstatus; + cywee_data = wear_status; + do_cywee_service_check_msg(CYWEE_SERVICE_CMD_WEAR_STATUS_CHANGE,&cywee_data); + } } } diff --git a/code/sdk/drivers/peripheral/ppg/hx3695/tyhx_hrs_custom.h b/code/sdk/drivers/peripheral/ppg/hx3695/tyhx_hrs_custom.h index bd64ef3ed..35bfef20d 100644 --- a/code/sdk/drivers/peripheral/ppg/hx3695/tyhx_hrs_custom.h +++ b/code/sdk/drivers/peripheral/ppg/hx3695/tyhx_hrs_custom.h @@ -8,7 +8,7 @@ * @Author: penglei 1624952103@qq.com * @Date: 2024-03-26 20:29:58 * @LastEditors: penglei 1624952103@qq.com - * @LastEditTime: 2024-04-30 09:31:34 + * @LastEditTime: 2024-09-05 19:04:40 * @FilePath: /FD230/code/sdk/drivers/peripheral/ppg/hx3695/tyhx_hrs_custom.h * @Description: * @@ -77,7 +77,8 @@ uint32_t tyhx_read_regs( uint8_t reg_addr,uint8_t *readbuf,uint16_t readlen); #define TYHX_TIMER_40MS 40 #define TYHX_TIMER_320MS 320 -#define TYHX_TIMER_5000MS 5000 +#define TYHX_TIMER_5000MS 1000 * 60 * 5 //纯佩戴修改为5分钟 +//#define TYHX_TIMER_5000MS 5000 bool tyhx_timer_start(uint32_t ms); bool tyhx_timer_stop(uint32_t ms); -- 2.17.1