From: penglei <1624952103@qq.com> Date: Wed, 31 Dec 2025 09:23:03 +0000 (+0800) Subject: 272增加心率广播 X-Git-Url: http://git.snicker.com.cn/css/static/gitweb.css?a=commitdiff_plain;h=refs%2Fchanges%2F3009%2Ftarget%2F1;p=mirrors%2FFD230.git 272增加心率广播 --- diff --git a/code/sdk/zhihui/drivers/ppg/hx3695/hx3695.c b/code/sdk/zhihui/drivers/ppg/hx3695/hx3695.c index 24009f8ae..11ae050fb 100644 --- a/code/sdk/zhihui/drivers/ppg/hx3695/hx3695.c +++ b/code/sdk/zhihui/drivers/ppg/hx3695/hx3695.c @@ -31,10 +31,17 @@ #ifdef SUPPORT_CYWEE_SERVICE #include "cywee_hal.h" #include "cywee_service.h" +#endif + +#ifdef CUSTOM_UTILS #include "custom_utils.h" #include "custom_runtime.h" #endif +#ifdef SUPPORT_PPG_BLE_SERVICE +#include "ppgBleService.h" +#endif + #include "ppg_hal.h" uint8_t read_fifo_first_flg = 0; @@ -69,7 +76,7 @@ static int32_t hrs_data[7] = {0}; static uint8_t left = 0; static uint8_t right = 0; static uint8_t avg_hrs = 0; - +static uint8_t time_cnt = 0; // static uint8_t his_wear = 2; // static uint8_t wear_cnt = 0; @@ -1420,6 +1427,19 @@ void hx3695_alg_send_data(ppg_sensor_data_t *ppg_sensor_dat, WORK_MODE_T mode, u living_status = 0; } } + time_cnt++; + if(time_cnt >= 3) + { + time_cnt = 0; +#ifdef SUPPORT_PPG_BLE_SERVICE + if(uapi_dev_runtime_get_hrs_ble_status()) + { + uint8_t ble_data = (uint8_t)avg_hrs; + ble_ppgtest_server_send_input_report(&ble_data,1); + } +#endif + } + break; }