|
@ -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; |
|
|
} |
|
|
} |
|
|