Index: firmware/App/Controllers/PresOccl.c =================================================================== diff -u -r5dc6f629ae40d8939fd3bd7c4e3dffb04fa137e7 -r69656450319bfcfdeffdc8f11e88084d4ea38d7d --- firmware/App/Controllers/PresOccl.c (.../PresOccl.c) (revision 5dc6f629ae40d8939fd3bd7c4e3dffb04fa137e7) +++ firmware/App/Controllers/PresOccl.c (.../PresOccl.c) (revision 69656450319bfcfdeffdc8f11e88084d4ea38d7d) @@ -54,8 +54,9 @@ #define MAX_TIME_BETWEEN_VENOUS_READINGS ( 500 / TASK_GENERAL_INTERVAL ) ///< Maximum time without fresh inline venous pressure reading. #define OCCLUSION_THRESHOLD 25000 ///< Threshold above which an occlusion is detected. +#define MINIMUM_PRESSURE_READING 2000 ///< Minimum pressure reading limit. +#define MAX_CARTRIDGE_LOADED_LIMIT 20000 ///< Pressure limit when cartridge is considered loaded. #define CARTRIDGE_LOADED_THRESHOLD 5000 ///< Threshold above which a cartridge is considered loaded. -#define MINIMUM_PRESSURE_LIMIT 2000 ///< Pressure reading minimum limit. #define PRES_ALARM_PERSISTENCE ( 1 * MS_PER_SECOND ) ///< Alarm persistence period for pressure alarms. @@ -561,11 +562,10 @@ /*********************************************************************//** * @brief - * The execPresOcclTest function executes the state machine for the - * PresOccl self-test. + * The execPresOcclTest function executes the PresOccl self-test. * @details Inputs: none * @details Outputs: none - * @return the current state of the PresOccl self-test. + * @return the result of the PresOccl self-test. *************************************************************************/ SELF_TEST_STATUS_T execPresOcclTest( void ) { @@ -575,17 +575,17 @@ U32 const dialysateInPressure = getMeasuredDialInPumpOcclusion(); U32 const dialysateOutPressure = getMeasuredDialOutPumpOcclusion(); - if ( ( bpPressure <= MINIMUM_PRESSURE_LIMIT ) || ( bpPressure >= OCCLUSION_THRESHOLD ) ) + if ( ( bpPressure <= MINIMUM_PRESSURE_READING ) || ( bpPressure >= OCCLUSION_THRESHOLD ) ) { result = SELF_TEST_STATUS_FAILED; } - if ( ( dialysateInPressure <= MINIMUM_PRESSURE_LIMIT ) || ( bpPressure >= OCCLUSION_THRESHOLD ) ) + if ( ( dialysateInPressure <= MINIMUM_PRESSURE_READING ) || ( dialysateInPressure >= OCCLUSION_THRESHOLD ) ) { result = SELF_TEST_STATUS_FAILED; } - if ( ( dialysateOutPressure <= MINIMUM_PRESSURE_LIMIT ) || ( bpPressure >= OCCLUSION_THRESHOLD ) ) + if ( ( dialysateOutPressure <= MINIMUM_PRESSURE_READING ) || ( dialysateOutPressure >= OCCLUSION_THRESHOLD ) ) { result = SELF_TEST_STATUS_FAILED; } @@ -594,8 +594,40 @@ return result; } + +/*********************************************************************//** + * @brief + * The execPresOcclDryTest function executes the PresOccl dry self-test. + * @details Inputs: none + * @details Outputs: none + * @return the result of the PresOccl dry self-test. + *************************************************************************/ +SELF_TEST_STATUS_T execPresOcclDryTest( void ) +{ + SELF_TEST_STATUS_T result = SELF_TEST_STATUS_PASSED; + + U32 const bpPressure = getMeasuredBloodPumpOcclusion(); + U32 const dialysateInPressure = getMeasuredDialInPumpOcclusion(); + U32 const dialysateOutPressure = getMeasuredDialOutPumpOcclusion(); + + if ( ( bpPressure <= CARTRIDGE_LOADED_THRESHOLD ) || ( bpPressure >= MAX_CARTRIDGE_LOADED_LIMIT ) ) + { + result = SELF_TEST_STATUS_FAILED; + } + + if ( ( dialysateInPressure <= CARTRIDGE_LOADED_THRESHOLD ) || ( dialysateInPressure >= MAX_CARTRIDGE_LOADED_LIMIT ) ) + { + result = SELF_TEST_STATUS_FAILED; + } + + if ( ( dialysateOutPressure <= CARTRIDGE_LOADED_THRESHOLD ) || ( dialysateOutPressure >= MAX_CARTRIDGE_LOADED_LIMIT ) ) + { + result = SELF_TEST_STATUS_FAILED; + } + + return result; +} - /************************************************************************* * TEST SUPPORT FUNCTIONS *************************************************************************/