From 11dd46be0a3b4d6acdfc7f317adcd468a6a4ea26 Mon Sep 17 00:00:00 2001 From: =?utf8?q?=E8=A2=81=E6=B8=85=E6=A2=A6?= <3449750381@qq.com> Date: Mon, 9 Feb 2026 03:25:35 +0000 Subject: [PATCH] Merge #3207 into fd272 from refs/changes/3207/head MIME-Version: 1.0 Content-Type: text/plain; charset=utf8 Content-Transfer-Encoding: 8bit Code review from 袁清梦 * refs/changes/3207/head: (3 commits squashed) - 睡眠时间更新 删除小睡的更新 - Merge branch 'fd272' of https://codeup.aliyun.com/64191456b9581d62e8f81ac0/FD230 into fd272 - 回退心率的修改 Signed-off-by: Caisking <3449750381@qq.com> Merged-by: Caisking <3449750381@qq.com> CR-link: https://codeup.aliyun.com/64191456b9581d62e8f81ac0/FD230/change/3207 --- code/sdk/zhihui/drivers/ppg/hx3695/hx3695.c | 53 +++++++------------ .../drivers/ppg/service/ppg_service.cpp | 2 +- 2 files changed, 21 insertions(+), 34 deletions(-) diff --git a/code/sdk/zhihui/drivers/ppg/hx3695/hx3695.c b/code/sdk/zhihui/drivers/ppg/hx3695/hx3695.c index a1cdf2a85..bbffc589e 100644 --- a/code/sdk/zhihui/drivers/ppg/hx3695/hx3695.c +++ b/code/sdk/zhihui/drivers/ppg/hx3695/hx3695.c @@ -545,49 +545,36 @@ bool hx3695_check_wear(ppg_sensor_data_t *ppg_sensor_dat,uint8_t count) if(wear_status_pre != wear_status) { + if(uapi_dev_runtime_get_train_status() && !wear_status) + avg_hrs = 0; wear_status_pre = wear_status; - - if(uapi_dev_runtime_get_train_status()) + if(uapi_dev_runtime_get_sleep_monitoring_status()) { - #ifdef SUPPORT_CYWEE_SERVICE - cywee_wear_status_update(&wear_status); - #endif if(!wear_status) { - avg_hrs = 0; + #ifdef SUPPORT_CYWEE_SERVICE + cywee_wear_status_update(&wear_status); + #endif } - } - else { - - if(uapi_dev_runtime_get_sleep_monitoring_status()) + else if(living_status == 1 && wear_status) { - if(!wear_status) - { - #ifdef SUPPORT_CYWEE_SERVICE - cywee_wear_status_update(&wear_status); - #endif - } - else if(living_status == 1 && wear_status) - { - #ifdef SUPPORT_CYWEE_SERVICE - cywee_wear_status_update(&wear_status); - #endif - } + #ifdef SUPPORT_CYWEE_SERVICE + cywee_wear_status_update(&wear_status); + #endif } - else + } + else + { + if(living_status != 2) { - if(living_status != 2) - { - #ifdef SUPPORT_CYWEE_SERVICE - cywee_wear_status_update(&wear_status); - #endif - } + #ifdef SUPPORT_CYWEE_SERVICE + cywee_wear_status_update(&wear_status); + #endif } } - // printf("wear_status:%d\n",wear_status); @@ -1696,11 +1683,11 @@ void wear_mode_timeout_handler(void * p_context) { // printf("wear_mode_timeout_handler \n"); if(work_mode_flag == WEAR_MODE) - { - #ifdef CHECK_TOUCH_LIB + { + #ifdef CHECK_TOUCH_LIB hx3695_ppg_Int_handle(&ppg_sensor_data); #endif - } + } } void hx3695_spo2_disable(void) diff --git a/code/sdk/zhihui/drivers/ppg/service/ppg_service.cpp b/code/sdk/zhihui/drivers/ppg/service/ppg_service.cpp index cf3beb626..07c93b3a1 100644 --- a/code/sdk/zhihui/drivers/ppg/service/ppg_service.cpp +++ b/code/sdk/zhihui/drivers/ppg/service/ppg_service.cpp @@ -229,7 +229,7 @@ errcode_t uapi_ppg_service_init(void) taskcfg.create_queue_handle = create_ppg_queue; taskcfg.attr.name="ppg_service"; - taskcfg.attr.priority = osPriorityAboveNormal2; + taskcfg.attr.priority = osPriorityAboveNormal3; taskcfg.attr.stack_size = PPG_SERVICE_TASK_SIZE; taskcfg.func = ppg_service_check_task; -- 2.17.1