272增加心率广播 3008/1 3008/head 3009/target/1
authorpenglei <1624952103@qq.com>
Wed, 31 Dec 2025 09:23:03 +0000 (17:23 +0800)
committerpenglei <1624952103@qq.com>
Wed, 31 Dec 2025 09:23:03 +0000 (17:23 +0800)
code/sdk/zhihui/drivers/ppg/hx3695/hx3695.c

index 24009f8..11ae050 100644 (file)
 #ifdef SUPPORT_CYWEE_SERVICE\r
 #include "cywee_hal.h"\r
 #include "cywee_service.h"\r
+#endif\r
+\r
+#ifdef CUSTOM_UTILS\r
 #include "custom_utils.h"\r
 #include "custom_runtime.h"\r
 #endif\r
 \r
+#ifdef SUPPORT_PPG_BLE_SERVICE\r
+#include "ppgBleService.h"\r
+#endif\r
+\r
 #include "ppg_hal.h"\r
 \r
 uint8_t read_fifo_first_flg = 0;\r
@@ -69,7 +76,7 @@ static int32_t hrs_data[7] = {0};
 static uint8_t left = 0;\r
 static uint8_t right = 0;\r
 static uint8_t avg_hrs = 0;\r
-\r
+static uint8_t time_cnt = 0;\r
 // static uint8_t his_wear = 2;\r
 // static uint8_t wear_cnt = 0;\r
 \r
@@ -1420,6 +1427,19 @@ void hx3695_alg_send_data(ppg_sensor_data_t *ppg_sensor_dat, WORK_MODE_T mode, u
                     living_status = 0;\r
                 }\r
             }\r
+            time_cnt++;\r
+            if(time_cnt >= 3)\r
+            {\r
+                time_cnt = 0;\r
+#ifdef SUPPORT_PPG_BLE_SERVICE\r
+                if(uapi_dev_runtime_get_hrs_ble_status())\r
+                {\r
+                    uint8_t ble_data = (uint8_t)avg_hrs;\r
+                    ble_ppgtest_server_send_input_report(&ble_data,1);\r
+                }\r
+#endif\r
+            }\r
+\r
 \r
                        break;\r
                }\r