Index: firmware/App/Controllers/DialOutFlow.c =================================================================== diff -u -rcf0f5e54c1a7af4d8a739cbd677d899d95e4019b -r2acaf549519854f7e6de1511d541582267f4d1e8 --- firmware/App/Controllers/DialOutFlow.c (.../DialOutFlow.c) (revision cf0f5e54c1a7af4d8a739cbd677d899d95e4019b) +++ firmware/App/Controllers/DialOutFlow.c (.../DialOutFlow.c) (revision 2acaf549519854f7e6de1511d541582267f4d1e8) @@ -25,6 +25,7 @@ #include "FPGA.h" #include "InternalADC.h" #include "ModeTreatment.h" +#include "NVDataMgmt.h" #include "OperationModes.h" #include "PIControllers.h" #include "SafetyShutdown.h" @@ -185,7 +186,8 @@ static U32 errorDialOutRotorSpeedPersistTimerCtr = 0; ///< Persistence timer counter for rotor speed error condition. static U32 errorDialOutPumpDirectionPersistTimerCtr = 0; ///< Persistence timer counter for pump direction error condition. -static U08 lastDialOutPumpDirectionCount = 0; ///< Previous pump direction error count reported by FPGA +static U08 lastDialOutPumpDirectionCount = 0; ///< Previous pump direction error count reported by FPGA. +static HD_PUMPS_CAL_RECORD_T dialOutPumpCalRecord; ///< Dialysate outlet calibration record. // ********** private function prototypes ********** @@ -476,6 +478,33 @@ /*********************************************************************//** * @brief + * The execDialOutFlowTest function executes the state machine for the + * DialOutFlow self-test. + * @details Inputs: none + * @details Outputs: dialOutPumpCalRecord + * @return the current state of the DialOutFlow self-test. + *************************************************************************/ +SELF_TEST_STATUS_T execDialOutFlowTest( void ) +{ + SELF_TEST_STATUS_T result = SELF_TEST_STATUS_PASSED; + + BOOL calStatus = getNVRecord2Driver( GET_CAL_PUMPS, (U08*)&dialOutPumpCalRecord, sizeof( HD_PUMPS_CAL_RECORD_T ), + NUM_OF_CAL_DATA_HD_PUMPS, ALARM_ID_NO_ALARM ); + + if ( TRUE == calStatus ) + { + result = SELF_TEST_STATUS_PASSED; + } + else + { + result = SELF_TEST_STATUS_FAILED; + } + + return result; +} + +/*********************************************************************//** + * @brief * The execDialOutFlowMonitor function executes the dialysate outlet pump * and load cell sensor monitor. Checks are performed. Data is published * at appropriate interval.