Index: firmware/App/Controllers/BloodFlow.c =================================================================== diff -u -r88a641b7b0185e0bad77e21e6d438e1d7283fd28 -r5dc6f629ae40d8939fd3bd7c4e3dffb04fa137e7 --- firmware/App/Controllers/BloodFlow.c (.../BloodFlow.c) (revision 88a641b7b0185e0bad77e21e6d438e1d7283fd28) +++ firmware/App/Controllers/BloodFlow.c (.../BloodFlow.c) (revision 5dc6f629ae40d8939fd3bd7c4e3dffb04fa137e7) @@ -102,7 +102,9 @@ /// Blood flow sensor signal strength low alarm persistence. #define FLOW_SIG_STRGTH_ALARM_PERSIST ( 5 * MS_PER_SECOND ) -#define MIN_FLOW_SIG_STRENGTH 0.9 ///< Minimum flow sensor signal strength (90%). +#define MIN_FLOW_SIG_STRENGTH 0.9 ///< Minimum flow sensor signal strength (90%). + +#define BFM_SENSOR_CONNECTED_STATUS 2 ///< Blood flow meter connected status. /// Enumeration of blood pump controller states. typedef enum BloodPump_States @@ -182,9 +184,6 @@ static U32 bpCurrErrorDurationCtr = 0; ///< Used for tracking persistence of bp current errors -static BLOOD_FLOW_SELF_TEST_STATE_T bloodPumpSelfTestState = BLOOD_FLOW_SELF_TEST_STATE_START; ///< Current blood pump self-test state -static U32 bloodPumpSelfTestTimerCount = 0; ///< Timer counter for blood pump self-test - // ********** private function prototypes ********** static BLOOD_PUMP_STATE_T handleBloodPumpOffState( void ); @@ -1261,28 +1260,12 @@ SELF_TEST_STATUS_T result = SELF_TEST_STATUS_FAILED; CALIBRATION_DATA_T cal; - switch ( bloodPumpSelfTestState ) + // Retrieve blood flow sensor calibration data and check for sensor connected status + if ( ( TRUE == getCalibrationData( &cal ) ) && ( BFM_SENSOR_CONNECTED_STATUS == getFPGABloodFlowMeterStatus() ) ) { - case BLOOD_FLOW_SELF_TEST_STATE_START: - // Retrieve blood flow sensor calibration data - if ( TRUE == getCalibrationData( &cal ) ) - { - bloodFlowCalGain = cal.bloodFlowGain; - bloodFlowCalOffset = cal.bloodFlowOffset_mL_min; - bloodPumpSelfTestState = BLOOD_FLOW_TEST_STATE_COMPLETE; // TODO - implement rest of self-test(s) - result = SELF_TEST_STATUS_PASSED; - } - break; - - case BLOOD_FLOW_TEST_STATE_IN_PROGRESS: - break; - - case BLOOD_FLOW_TEST_STATE_COMPLETE: - break; - - default: - // TODO - s/w fault - break; + bloodFlowCalGain = cal.bloodFlowGain; + bloodFlowCalOffset = cal.bloodFlowOffset_mL_min; + result = SELF_TEST_STATUS_PASSED; } return result;