From 91f4e2cde84b6806a04542ea5fda796339e42400 Mon Sep 17 00:00:00 2001 From: penglei <1624952103@qq.com> Date: Sat, 29 Nov 2025 16:40:40 +0800 Subject: [PATCH] =?utf8?q?=E4=BF=AE=E5=A4=8D272=E8=BF=90=E5=8A=A8=E6=AD=BB?= =?utf8?q?=E6=9C=BA?= MIME-Version: 1.0 Content-Type: text/plain; charset=utf8 Content-Transfer-Encoding: 8bit --- code/sdk/zhihui/drivers/ppg/hx3695/hx3695.c | 45 +++++++++++-------- code/sdk/zhihui/services/gnss/src/uart_gnss.c | 2 +- 2 files changed, 28 insertions(+), 19 deletions(-) diff --git a/code/sdk/zhihui/drivers/ppg/hx3695/hx3695.c b/code/sdk/zhihui/drivers/ppg/hx3695/hx3695.c index bf5f5c2a9..24009f8ae 100644 --- a/code/sdk/zhihui/drivers/ppg/hx3695/hx3695.c +++ b/code/sdk/zhihui/drivers/ppg/hx3695/hx3695.c @@ -1384,32 +1384,41 @@ void hx3695_alg_send_data(ppg_sensor_data_t *ppg_sensor_dat, WORK_MODE_T mode, u hrs_result = tyhx_hrs_alg_get_results(); DEBUG_PRINTF("HRS: %d %d\r\n",hrs_result.data_cnt, hrs_result.hr_result); // printf("hr:%d, living:%d, wear_status:%d\n", hrs_result.hr_result,hrs_result.living_status,wear_status); - if(hrs_result.living_status == MSG_LIVING_TRUE) + + if(uapi_dev_runtime_get_train_status()) { - living_wear_cnt = 0; - if(hrs_result.hr_result >= 30 && hrs_result.hr_result <= 210) get_avg_hrs(hrs_result.hr_result); - - living_status = 1; } - else if(hrs_result.living_status == MSG_LIVING_FAIL) + else { - living_wear_cnt++; - if(living_wear_cnt >= 5) + if(hrs_result.living_status == MSG_LIVING_TRUE) { - avg_hrs = 0; - living_status = 2; - wear_status = 0; - wear_status_pre = 0; - hx3695_unwearstatus_update(); living_wear_cnt = 0; + + if(hrs_result.hr_result >= 30 && hrs_result.hr_result <= 210) + get_avg_hrs(hrs_result.hr_result); + + living_status = 1; + } + else if(hrs_result.living_status == MSG_LIVING_FAIL) + { + living_wear_cnt++; + if(living_wear_cnt >= 5) + { + avg_hrs = 0; + living_status = 2; + wear_status = 0; + wear_status_pre = 0; + hx3695_unwearstatus_update(); + living_wear_cnt = 0; + } + } + else + { + living_wear_cnt = 0; + living_status = 0; } - } - else - { - living_wear_cnt = 0; - living_status = 0; } break; diff --git a/code/sdk/zhihui/services/gnss/src/uart_gnss.c b/code/sdk/zhihui/services/gnss/src/uart_gnss.c index 10ae4b272..33a073bef 100644 --- a/code/sdk/zhihui/services/gnss/src/uart_gnss.c +++ b/code/sdk/zhihui/services/gnss/src/uart_gnss.c @@ -219,7 +219,7 @@ void gnss_receive_handler(uint8_t *buffer, int32_t size) } #define GNSS_CMD_TASK_MSG_COUNT 128 -#define GNSS_CMD_TASK_SIZE (0x800*2) +#define GNSS_CMD_TASK_SIZE (0x2500) #define GNSS_CMD_TASK_PRIO 4 void create_gnss_uart_queue(void) { -- 2.17.1