Index: firmware/App/Modes/SelfTests.c =================================================================== diff -u -r814e18d5ba31fa8e35d76e095369d56dd5c70fac -r2ecbac1618a09e6992889283cef6190cae8d7f7a --- firmware/App/Modes/SelfTests.c (.../SelfTests.c) (revision 814e18d5ba31fa8e35d76e095369d56dd5c70fac) +++ firmware/App/Modes/SelfTests.c (.../SelfTests.c) (revision 2ecbac1618a09e6992889283cef6190cae8d7f7a) @@ -127,6 +127,7 @@ static U32 bloodLeakDebubbleStartTimeMS; ///< Blood leak detector debubble start time in milliseconds. static BOOL useHeparin; ///< Flag indicates the user of heparin. +static BOOL heparinOcclusionTestRun; ///< Flag indicates whether the heparin occlusion test has been run. static BOOL selfTestsResumeRequested; ///< Flag indicates user requesting self-tests resume. static BOOL cartridgeUsedTestRun; ///< Flag indicates whether the used cartridge test has been run. static BOOL occlusionBaselineWasSet; ///< Flag indicates whether the blood pump occlusion baseline for installed cartridge has been set. @@ -426,6 +427,7 @@ dryPressureTestsCompleted = FALSE; cartridgeUsedTestRun = FALSE; occlusionBaselineWasSet = FALSE; + heparinOcclusionTestRun = FALSE; selfTestStartTime = getMSTimerCount(); selfTestPreviousPublishDataTime = getMSTimerCount(); selfTestCartridgeSettleTime = getMSTimerCount(); @@ -608,6 +610,8 @@ setValvePosition( VBA, VALVE_POSITION_C_CLOSE ); setValvePosition( VBV, VALVE_POSITION_C_CLOSE ); + setCurrent4thLevelState( currentWetSelfTestsState ); + resetSelfTestsFlags(); } @@ -1532,8 +1536,8 @@ * @brief * The handleDrySelfTestSyringePumpOcclusionDetectionState function handles * occlusion detection after prime has completed. - * @details Inputs: none - * @details Outputs: none + * @details Inputs: syringeOcclusionDelayStartTime + * @details Outputs: heparinOcclusionTestRun * @return the next state of dry self-tests state machine *************************************************************************/ static DRY_SELF_TESTS_STATE_T handleDrySelfTestSyringePumpOcclusionDetectionState( void ) @@ -1546,6 +1550,7 @@ { state = DRY_SELF_TESTS_COMPLETE_STATE; } + heparinOcclusionTestRun = TRUE; } if ( TRUE == doesAlarmStatusIndicateStop() ) @@ -1562,7 +1567,7 @@ * The handleDrySelfTestStoppedState function handles the stopped dry self-tests * operation. * @details Inputs: selfTestsResumeRequested, occlusionBaselineWasSet, - * dryPressureTestsCompleted, cartridgeUsedTestRun + * dryPressureTestsCompleted, cartridgeUsedTestRun, heparinOcclusionTestRun * @details Outputs: selfTestsResumeRequested, selfTestStartTime, selfTestCartridgeSettleTime * @return the next state of dry self-tests state machine *************************************************************************/ @@ -1590,6 +1595,12 @@ } } + // if heparin occlusin alarm, keep calling check function so alarm condition will clear when resolved + if ( TRUE == isAlarmActive( ALARM_ID_HD_SYRINGE_PUMP_OCCLUSION ) ) + { + checkForSyringeOcclusion( FALSE ); + } + // if resume request, resume dry self-tests if ( TRUE == selfTestsResumeRequested ) { @@ -1599,8 +1610,12 @@ selfTestCartridgeSettleTime = getMSTimerCount(); doorClosedRequired( TRUE, TRUE ); - if ( TRUE == dryPressureTestsCompleted ) + if ( TRUE == heparinOcclusionTestRun ) { + state = DRY_SELF_TESTS_COMPLETE_STATE; + } + else if ( TRUE == dryPressureTestsCompleted ) + { state = DRY_SELF_TESTS_SYRINGE_PUMP_PRIME_STATE; } else