调整佩戴检测阈值,缩短检测时长 1419/1
authorpenglei <1624952103@qq.com>
Mon, 18 Nov 2024 09:44:32 +0000 (17:44 +0800)
committerpenglei <1624952103@qq.com>
Mon, 18 Nov 2024 09:44:32 +0000 (17:44 +0800)
code/sdk/drivers/peripheral/ppg/hx3695/hx3695.c
code/sdk/drivers/peripheral/ppg/hx3695/hx3695_check_touch.c
code/sdk/drivers/peripheral/ppg/hx3695/tyhx_hrs_custom.h

index e670d4b..7d5132e 100644 (file)
@@ -117,8 +117,8 @@ const int32_t  spo2_ir_unwear_thres = 8000;     //demo143b  25000   30000
 const int32_t  spo2_ir_wear_thres = 10000;\r
 const uint8_t  spo2_ir_wear_offset = 15;\r
 //CHECK_WEAR_MODE_THRES\r
-const int32_t  check_mode_unwear_thre = 25000;\r
-const int32_t  check_mode_wear_thre = 30000;\r
+const int32_t  check_mode_unwear_thre = 20000;\r
+const int32_t  check_mode_wear_thre = 20000;\r
 \r
 \r
 uint8_t alg_ram[11 * 1024] __attribute__((aligned(4)));\r
index 4bc19df..5f41645 100644 (file)
@@ -9,7 +9,7 @@
 #include "hx3695.h"\r
 #include "hx3695_check_touch.h"\r
 #include "hx3695_hrs_agc.h"\r
-\r
+#include "cywee_hal.h"\r
 \r
 hx3695_wear_msg_code_t hx3695_wear_status = MSG_NO_WEAR;\r
 hx3695_wear_msg_code_t hx3695_wear_status_pre = MSG_NO_WEAR;\r
@@ -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)\r
 {\r
     ir_data = Ir_data;\r
-    // PRINT("ir_data : %d \r\n",ir_data);\r
-    if(ir_data > 80000)\r
+    // uint32_t tm;\r
+    // uapi_get_timestampe_ss(&tm);\r
+    // CWM_OS_dbgPrintf("ir_data : %d tm : %d\r\n",ir_data,tm);\r
+    if(ir_data > 60000)\r
     {\r
         touch_cnt = 0;\r
         if(notouch_cnt>=2)\r
@@ -193,7 +195,7 @@ hx3695_wear_msg_code_t check_touch_alg(int32_t ir_data)
             notouch_cnt++;\r
         }\r
     }\r
-    else if(ir_data>check_mode_wear_thre && ir_data < 80000)\r
+    else if(ir_data>check_mode_wear_thre && ir_data < 60000)\r
     {\r
         notouch_cnt = 0;\r
         if(touch_cnt>=2)\r
index b9f6bbd..d956bbd 100644 (file)
@@ -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);