From: Caisking <3449750381@qq.com> Date: Thu, 5 Sep 2024 07:19:30 +0000 (+0800) Subject: 心率增加0数据传递,报0显示“--“ X-Git-Tag: release_V1.2.70_20241020_135402~518^2~25 X-Git-Url: http://git.snicker.com.cn/css/static/gitweb.css?a=commitdiff_plain;h=85dfd0e1c60df3c90ea5017c58f111aa797efa52;p=mirrors%2FFD230.git 心率增加0数据传递,报0显示“--“ --- diff --git a/code/sdk/drivers/peripheral/ppg/hx3695/hx3695.c b/code/sdk/drivers/peripheral/ppg/hx3695/hx3695.c index ef80e512a..67484b953 100644 --- a/code/sdk/drivers/peripheral/ppg/hx3695/hx3695.c +++ b/code/sdk/drivers/peripheral/ppg/hx3695/hx3695.c @@ -2708,16 +2708,7 @@ static void get_avg_hrs(int32_t hrs) } avg_hrs = (sum_hrs - max_hrs - min_hrs) / (hrs_num - 2); //PRINT("max_hrs[%d],min_hrs[%d],avg_hrs[%d]\n",max_hrs,min_hrs,avg_hrs); - hx3695_msg_callback_t func = hx3695_get_send_msg_callback_func(); - if(func != NULL) - { - hrsresult.lastesthrs = avg_hrs; - func(HX3695_MSG_TYPE_HRS_UPDATE,&hrsresult,sizeof(FT_CUSTOM_RESULTS_t)); - if(uapi_get_cywee_static_state()) - { - func(HX3695_MSG_TYPE_STATIC_HRS_UPDATE,&hrsresult,sizeof(FT_CUSTOM_RESULTS_t)); - } - } + hrsresult.lastesthrs = avg_hrs; if(hrs_mode_state) { cywee_data = hrsresult.lastesthrs; @@ -2894,20 +2885,28 @@ void hx3695_hrs_ppg_Int_handle(void) if(hrs_wear_status == MSG_HRS_WEAR && hrsresult.hr_living == MSG_LIVING_TRUE) { - if(hrsresult.lastesthrs > 50) + if(hrsresult.lastesthrs > 60 || hrsresult.lastesthrs == 0) get_avg_hrs(hrsresult.lastesthrs); hrsresult.wearstatus = MSG_HRS_WEAR; } else { hrsresult.wearstatus = MSG_HRS_NO_WEAR; + hrsresult.lastesthrs = 0; } hx3695_msg_callback_t func = hx3695_get_send_msg_callback_func(); if(func != NULL) { - func(HX3695_MSG_TYPE_WEARSTAT_UPDATE,&hrsresult,sizeof(FT_CUSTOM_RESULTS_t)); + PRINT("hrsresult.lastesthrs : %d \n",hrsresult.lastesthrs); + func(HX3695_MSG_TYPE_HRS_UPDATE,&hrsresult,sizeof(FT_CUSTOM_RESULTS_t)); + if(uapi_get_cywee_static_state()) + { + func(HX3695_MSG_TYPE_STATIC_HRS_UPDATE,&hrsresult,sizeof(FT_CUSTOM_RESULTS_t)); + } + func(HX3695_MSG_TYPE_WEARSTAT_UPDATE,&hrsresult,sizeof(FT_CUSTOM_RESULTS_t)); } + //PRINT("hx3695 data_cnt: %d, hr_living: %d, hr_living_qu: %d, hr_living_std: %d, hr_result:%d \r\n", //alg_results.data_cnt, hrsresult.hr_living, hrsresult.hr_living_qu, hrsresult.hr_living_std, hrsresult.lastesthrs);