From e1bbad0c8a90417589b80256da417f39980b5ffc Mon Sep 17 00:00:00 2001 From: Caisking Date: Mon, 9 Feb 2026 09:38:53 +0800 Subject: [PATCH] =?utf8?q?=E5=9B=9E=E9=80=80=E5=BF=83=E7=8E=87=E7=9A=84?= =?utf8?q?=E4=BF=AE=E6=94=B9?= MIME-Version: 1.0 Content-Type: text/plain; charset=utf8 Content-Transfer-Encoding: 8bit --- 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