Browse Source

update

master
zhaohe 1 year ago
parent
commit
c3d3875add
  1. 2
      app/src/app_service/ecg_service/ecg_algo.c
  2. 22
      app/src/app_service/ecg_service/ecg_service.c
  3. 2
      app/src/aproject_config/config.h

2
app/src/app_service/ecg_service/ecg_algo.c

@ -6,7 +6,7 @@
#include "algo/zsimple_qrs.h" #include "algo/zsimple_qrs.h"
#include "znordic.h" #include "znordic.h"
#define REPORT_MEDIAN_WINDOWS_SIZE 101 // 必须是奇数
#define REPORT_MEDIAN_WINDOWS_SIZE 121 // 必须是奇数
LPFilterExt_t m_lp_filter; LPFilterExt_t m_lp_filter;
HPFilterExt_t m_hp_filter; HPFilterExt_t m_hp_filter;

22
app/src/app_service/ecg_service/ecg_service.c

@ -211,7 +211,12 @@ static void leadoff_state_process(ads129x_capture_data_t* capture_data) {
*/ */
static uint32_t un_lead_off_cnt = 0; static uint32_t un_lead_off_cnt = 0;
bool leadoff = false; bool leadoff = false;
if (capture_data->ch1data > 34000 || capture_data->ch1data < -34000) {
int32_t abs_af_filter = ecg_algo_get_report_data();
if (abs_af_filter < 0) {
abs_af_filter = -abs_af_filter;
}
if (abs_af_filter < 500) {
leadoff = true; leadoff = true;
} }
@ -221,7 +226,7 @@ static void leadoff_state_process(ads129x_capture_data_t* capture_data) {
un_lead_off_cnt = 0; un_lead_off_cnt = 0;
} }
if (un_lead_off_cnt > 10) {
if (un_lead_off_cnt > 300) {
un_lead_off_cnt = 0; un_lead_off_cnt = 0;
m_leadoffstate = true; m_leadoffstate = true;
} }
@ -231,20 +236,20 @@ static void leadoff_state_process(ads129x_capture_data_t* capture_data) {
* @brief µ¼Áª»Ö¸´¼ì²â * @brief µ¼Áª»Ö¸´¼ì²â
*/ */
static uint32_t cnt = 0;
static uint32_t cnt = 0;
int32_t abs_af_filter = ecg_algo_get_report_data();
int32_t absraw = capture_data->ch1data;
if (absraw < 0) {
absraw = -absraw;
if (abs_af_filter < 0) {
abs_af_filter = -abs_af_filter;
} }
if (absraw < 25000) {
if (abs_af_filter > 1500) {
cnt++; cnt++;
} else { } else {
cnt = 0; cnt = 0;
} }
if (cnt > 3) {
if (cnt > 6) {
cnt = 0; cnt = 0;
m_leadoffstate = false; m_leadoffstate = false;
} }
@ -434,7 +439,6 @@ void ecg_service_set_in_test_mode(bool testmode) {
void ecg_service_set_report_data_in_raw_mode(bool rawmode) { m_report_data_in_raw_mode_flag = rawmode; } void ecg_service_set_report_data_in_raw_mode(bool rawmode) { m_report_data_in_raw_mode_flag = rawmode; }
bool ecg_leadoff_detect() { bool ecg_leadoff_detect() {
return false;
if (m_testmode_flag) { if (m_testmode_flag) {
return false; return false;
} }

2
app/src/aproject_config/config.h

@ -7,7 +7,7 @@
#define CATEGORY "M1003" // 데돔젬 #define CATEGORY "M1003" // 데돔젬
#define MANUFACTURER_NAME "iflytop" #define MANUFACTURER_NAME "iflytop"
#define FIRMWARE_VERSION (507)
#define FIRMWARE_VERSION (508)
#define BLESTACK_VERSION 1 #define BLESTACK_VERSION 1
#define BOOTLOADER_VERSION 1 #define BOOTLOADER_VERSION 1
#define HARDWARE_VERSION (2) #define HARDWARE_VERSION (2)

Loading…
Cancel
Save