#define MAX_UNWARE_COUNT 10
#define MAX_VALID_SPO2_COUNT 30
#define MAX_DISVALID_SPO2_COUNT 100
-static uint16 CalibrationFlag = 0;
+ static uint16 CalibrationFlag = 0;
// 声明定时器变量
static osTimerId_t g_timer = nullptr;
static BPModel instance;
return &instance;
}
- int16_t BPModel::GetCalibrationFlag()
+ int16_t BPModel::GetCalibrationFlag()
{
-
+
return CalibrationFlag;
}
if (set_value)
{
if (type == BP_VALUE_TYPE::SBP)
- custom_sbp++;
- else
- custom_dbp++;
+ if (custom_sbp < 250)
+ custom_sbp++;
+ else if (custom_dbp < 150)
+ custom_dbp++;
}
else
{
if (type == BP_VALUE_TYPE::SBP)
- custom_sbp--;
- else
- custom_dbp--;
+ if (custom_sbp > 50)
+ custom_sbp--;
+ else if (custom_dbp > 30)
+ custom_dbp--;
}
}
int16_t BPModel::GetValue(BP_VALUE_TYPE type)
/*定时器到期时的处理*/
static void BP_TimerCallbackProc(int data)
{
-
// 倒计时
Time--;
BPMainView::GetInstance()->ChangeView(BPUNDERCALIBRATIONVIEW, BPCALIBRATIONMINDVIEW);
CalibrationFlag++;
}
- else if (BPMainView::GetInstance() && ( CalibrationFlag == 1 || CalibrationFlag == 3)) // 分析完
+ else if (BPMainView::GetInstance() && (CalibrationFlag == 1 || CalibrationFlag == 3)) // 分析完
{
// 校准成功
BPMainView::GetInstance()->ChangeView(BPRESULTANALYSISVIEW, BPCALIBRATIONPASSVIEW);