From: penglei <1624952103@qq.com> Date: Sun, 2 Nov 2025 08:53:58 +0000 (+0800) Subject: 增加hrv开关接口 X-Git-Tag: V1.0.9_20251128_194606_LN~127 X-Git-Url: http://git.snicker.com.cn/css/static/gitweb.css?a=commitdiff_plain;h=0d177a2a713b2d432e9b0f6aa485a34b2a7e2336;p=mirrors%2FFD230.git 增加hrv开关接口 --- diff --git a/code/sdk/zhihui/drivers/ppg/service/ppg_service.cpp b/code/sdk/zhihui/drivers/ppg/service/ppg_service.cpp index 8b7e7fc65..83aa5acee 100644 --- a/code/sdk/zhihui/drivers/ppg/service/ppg_service.cpp +++ b/code/sdk/zhihui/drivers/ppg/service/ppg_service.cpp @@ -150,6 +150,11 @@ static void ppg_service_check_task(void *arg) cmd = "spo2"; enable = 0; } + else if (mail == PPG_SERVICE_CMD_TYPE_STOP_HRV_TEST){ + + cmd = "hrv"; + enable = 0; + } else if (mail == PPG_SERVICE_CMD_TYPE_INT_HANDLER){ ppg_int_handler(); continue; @@ -271,6 +276,17 @@ void ppg_spo2_stop(void) send_ppg_cmd_msg(PPG_SERVICE_CMD_TYPE_STOP_SPO2_TEST); } +void ppg_hrv_start(void) +{ + send_ppg_cmd_msg(PPG_SERVICE_CMD_TYPE_DO_HRV_TEST); +} + +void ppg_hrv_stop(void) +{ + send_ppg_cmd_msg(PPG_SERVICE_CMD_TYPE_STOP_HRV_TEST); +} + + // void ppg_service_service_resume(void) // { // DEBUG_PRINTF("ppg_service_service resume!\r\n"); diff --git a/code/sdk/zhihui/drivers/ppg/service/ppg_service.h b/code/sdk/zhihui/drivers/ppg/service/ppg_service.h index 6b1ea38b0..50ef0588f 100644 --- a/code/sdk/zhihui/drivers/ppg/service/ppg_service.h +++ b/code/sdk/zhihui/drivers/ppg/service/ppg_service.h @@ -2,7 +2,7 @@ * @Author: penglei 1624952103@qq.com * @Date: 2024-03-27 09:07:00 * @LastEditors: penglei 1624952103@qq.com - * @LastEditTime: 2025-07-15 11:10:21 + * @LastEditTime: 2025-11-02 16:53:00 * @FilePath: /FD230/code/sdk/drivers/peripheral/ppg/service/ppg_service.h * @Description: * @@ -49,6 +49,7 @@ extern "C" { #define PPG_SERVICE_CMD_TYPE_CLOSE_HRS_BLE 0x25 #define PPG_SERVICE_CMD_TYPE_FPC_TEST 0x27 #define PPG_SERVICE_CMD_TYPE_FACTORY_TEST 0x28 +#define PPG_SERVICE_CMD_TYPE_STOP_HRV_TEST 0x29 errcode_t uapi_ppg_service_init(void); void uapi_ppg_service_deinit(void); @@ -91,6 +92,8 @@ void ppg_hr_start(void); void ppg_hr_stop(void); void ppg_spo2_start(void); void ppg_spo2_stop(void); +void ppg_hrv_start(void); +void ppg_hrv_stop(void); #ifdef __cplusplus #if __cplusplus