From eb06061ca0ca384ac674dfe9de25f9c450819e95 Mon Sep 17 00:00:00 2001 From: Caisking Date: Sat, 7 Feb 2026 11:41:36 +0800 Subject: [PATCH] =?utf8?q?=E4=BF=AE=E5=A4=8D=E8=BF=90=E5=8A=A8=E5=8D=A1?= =?utf8?q?=E8=B7=AF=E9=87=8C=E4=B8=8D=E5=87=BA=E5=80=BC=E7=9A=84=E9=97=AE?= =?utf8?q?=E9=A2=98?= MIME-Version: 1.0 Content-Type: text/plain; charset=utf8 Content-Transfer-Encoding: 8bit --- code/sdk/zhihui/drivers/ppg/hx3695/hx3695.c | 47 +++++++++++++-------- 1 file changed, 30 insertions(+), 17 deletions(-) diff --git a/code/sdk/zhihui/drivers/ppg/hx3695/hx3695.c b/code/sdk/zhihui/drivers/ppg/hx3695/hx3695.c index bbc12d907..a1cdf2a85 100644 --- a/code/sdk/zhihui/drivers/ppg/hx3695/hx3695.c +++ b/code/sdk/zhihui/drivers/ppg/hx3695/hx3695.c @@ -545,36 +545,49 @@ 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_sleep_monitoring_status()) + + if(uapi_dev_runtime_get_train_status()) { + #ifdef SUPPORT_CYWEE_SERVICE + cywee_wear_status_update(&wear_status); + #endif if(!wear_status) { - #ifdef SUPPORT_CYWEE_SERVICE - cywee_wear_status_update(&wear_status); - #endif + avg_hrs = 0; } - else if(living_status == 1 && wear_status) + } + else { + + if(uapi_dev_runtime_get_sleep_monitoring_status()) { - #ifdef SUPPORT_CYWEE_SERVICE - cywee_wear_status_update(&wear_status); - #endif + 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 + } } - } - else - { - if(living_status != 2) + else { + 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); -- 2.17.1