From: penglei <1624952103@qq.com> Date: Mon, 18 Nov 2024 09:44:32 +0000 (+0800) Subject: 调整佩戴检测阈值,缩短检测时长 X-Git-Tag: fd230_release_V1.3.102~56^2~8 X-Git-Url: http://git.snicker.com.cn/css/static/gitweb.css?a=commitdiff_plain;h=refs%2Fchanges%2F1419%2F1;p=mirrors%2FFD230.git 调整佩戴检测阈值,缩短检测时长 --- diff --git a/code/sdk/drivers/peripheral/ppg/hx3695/hx3695.c b/code/sdk/drivers/peripheral/ppg/hx3695/hx3695.c index e670d4b96..7d5132efc 100644 --- a/code/sdk/drivers/peripheral/ppg/hx3695/hx3695.c +++ b/code/sdk/drivers/peripheral/ppg/hx3695/hx3695.c @@ -117,8 +117,8 @@ const int32_t spo2_ir_unwear_thres = 8000; //demo143b 25000 30000 const int32_t spo2_ir_wear_thres = 10000; const uint8_t spo2_ir_wear_offset = 15; //CHECK_WEAR_MODE_THRES -const int32_t check_mode_unwear_thre = 25000; -const int32_t check_mode_wear_thre = 30000; +const int32_t check_mode_unwear_thre = 20000; +const int32_t check_mode_wear_thre = 20000; uint8_t alg_ram[11 * 1024] __attribute__((aligned(4))); diff --git a/code/sdk/drivers/peripheral/ppg/hx3695/hx3695_check_touch.c b/code/sdk/drivers/peripheral/ppg/hx3695/hx3695_check_touch.c index 4bc19df23..5f41645a8 100644 --- a/code/sdk/drivers/peripheral/ppg/hx3695/hx3695_check_touch.c +++ b/code/sdk/drivers/peripheral/ppg/hx3695/hx3695_check_touch.c @@ -9,7 +9,7 @@ #include "hx3695.h" #include "hx3695_check_touch.h" #include "hx3695_hrs_agc.h" - +#include "cywee_hal.h" hx3695_wear_msg_code_t hx3695_wear_status = MSG_NO_WEAR; hx3695_wear_msg_code_t hx3695_wear_status_pre = MSG_NO_WEAR; @@ -179,8 +179,10 @@ hx3695_wear_msg_code_t hx3695_check_touch_send_data(int32_t *ir_data, uint8_t co hx3695_wear_msg_code_t check_touch_alg(int32_t ir_data) { ir_data = Ir_data; - // PRINT("ir_data : %d \r\n",ir_data); - if(ir_data > 80000) + // uint32_t tm; + // uapi_get_timestampe_ss(&tm); + // CWM_OS_dbgPrintf("ir_data : %d tm : %d\r\n",ir_data,tm); + if(ir_data > 60000) { touch_cnt = 0; if(notouch_cnt>=2) @@ -193,7 +195,7 @@ hx3695_wear_msg_code_t check_touch_alg(int32_t ir_data) notouch_cnt++; } } - else if(ir_data>check_mode_wear_thre && ir_data < 80000) + else if(ir_data>check_mode_wear_thre && ir_data < 60000) { notouch_cnt = 0; if(touch_cnt>=2) diff --git a/code/sdk/drivers/peripheral/ppg/hx3695/tyhx_hrs_custom.h b/code/sdk/drivers/peripheral/ppg/hx3695/tyhx_hrs_custom.h index b9f6bbd63..d956bbd89 100644 --- a/code/sdk/drivers/peripheral/ppg/hx3695/tyhx_hrs_custom.h +++ b/code/sdk/drivers/peripheral/ppg/hx3695/tyhx_hrs_custom.h @@ -8,7 +8,7 @@ * @Author: penglei 1624952103@qq.com * @Date: 2024-03-26 20:29:58 * @LastEditors: penglei 1624952103@qq.com - * @LastEditTime: 2024-10-19 18:54:33 + * @LastEditTime: 2024-11-18 17:32:40 * @FilePath: /FD230/code/sdk/drivers/peripheral/ppg/hx3695/tyhx_hrs_custom.h * @Description: * @@ -77,7 +77,7 @@ uint32_t tyhx_read_regs( uint8_t reg_addr,uint8_t *readbuf,uint16_t readlen); #define TYHX_TIMER_40MS 40 #define TYHX_TIMER_320MS 320 -#define TYHX_TIMER_5000MS 1000 * 60 //纯佩戴修改为1分钟 优化小睡入睡时间计算 +#define TYHX_TIMER_5000MS 1000 * 5 //纯佩戴修改为1分钟 优化小睡入睡时间计算 //#define TYHX_TIMER_5000MS 5000 bool tyhx_timer_start(uint32_t ms);