Index: firmware/App/Modes/SelfTests.c =================================================================== diff -u -r94dab74a6432263dc4569e0cf8f9fa0b01bf1917 -r3633c7c348e95b11175dfb4a4a183bdb6cd24478 --- firmware/App/Modes/SelfTests.c (.../SelfTests.c) (revision 94dab74a6432263dc4569e0cf8f9fa0b01bf1917) +++ firmware/App/Modes/SelfTests.c (.../SelfTests.c) (revision 3633c7c348e95b11175dfb4a4a183bdb6cd24478) @@ -232,14 +232,14 @@ F32 const hepRate = getTreatmentParameterF32( TREATMENT_PARAM_HEPARIN_DISPENSE_RATE ); #ifndef _RELEASE_ - if ( getSoftwareConfigStatus( SW_CONFIG_DISABLE_SYRINGE_PUMP ) != SW_CONFIG_ENABLE_VALUE ) + if ( SW_CONFIG_ENABLE_VALUE == getSoftwareConfigStatus( SW_CONFIG_DISABLE_SYRINGE_PUMP ) ) { - useHeparin = ( ( bolusVol > 0.0 ) || ( hepRate > 0.0 ) ? TRUE : FALSE ); + useHeparin = FALSE; } else #endif { - useHeparin = FALSE; + useHeparin = ( ( bolusVol > 0.0 ) || ( hepRate > 0.0 ) ? TRUE : FALSE ); } currentNoCartSelfTestsState = NO_CART_SELF_TESTS_START_STATE; @@ -403,7 +403,6 @@ *************************************************************************/ void execDrySelfTests( void ) { - // execute dry self-tests state machine switch ( currentDrySelfTestsState ) { @@ -566,8 +565,6 @@ *************************************************************************/ void execWetSelfTests( void ) { - SELF_TEST_STATUS_T result = SELF_TEST_STATUS_PASSED; - #ifndef _RELEASE_ if ( getSoftwareConfigStatus( SW_CONFIG_DISABLE_WET_SELF_TEST ) == SW_CONFIG_ENABLE_VALUE ) { @@ -637,11 +634,6 @@ // Self-tests flags should be handled by now, reset if flags not handled with current state resetSelfTestsFlags(); - - if ( SELF_TEST_STATUS_FAILED == result ) - { - SET_ALARM_WITH_1_U32_DATA( ALARM_ID_PRE_TREATMENT_WET_LC_TEST_FAILURE, currentWetSelfTestsState ); - } } /*********************************************************************//** @@ -740,7 +732,7 @@ if ( TRUE == useHeparin ) { - if ( TRUE == isSyringePumpStopped() ) + if ( ( isSyringePumpHome() != TRUE ) && ( TRUE == isSyringePumpStopped() ) ) { retractSyringePump(); } @@ -1174,6 +1166,10 @@ { seekSyringePlunger(); } + else + { + retractSyringePump(); + } } } } @@ -1390,7 +1386,6 @@ BUBBLE_STATUS_T const ADVBubbleStatus = getBubbleStatus( ADV ); - if ( BUBBLE_NOT_DETECTED == ADVBubbleStatus ) { #ifndef _RELEASE_ @@ -1528,8 +1523,8 @@ * @brief * The handleWetSelfTestFirstDisplacementVerifyState function checks the load cell * readings and FMD integrated volume after the first dialysate displacement. - * @details Inputs: settleStartTime, reservoirVolume[], reservoirs' weights - * @details Outputs: verify correctness of dialysate flow meter and load cell + * @details Inputs: settleStartTime, fmdIntegratedVolume + * @details Outputs: none * @return the next state of wet self-tests state machine *************************************************************************/ static WET_SELF_TESTS_STATE_T handleWetSelfTestFirstDisplacementVerifyState( void ) @@ -1546,7 +1541,7 @@ F32 integrateVolumeToleranceG = WET_SELF_TEST_INTEGRATED_VOLUME_TOLERANCE; #ifndef _RELEASE_ - if ( SW_CONFIG_ENABLE_VALUE == getSoftwareConfigStatus( SW_CONFIG_ENABLE_DVT_ARTERIAL_PRESSURE_SENSOR ) ) + if ( SW_CONFIG_ENABLE_VALUE == getSoftwareConfigStatus( SW_CONFIG_ENABLE_WET_SELF_TEST_WIDER_VOLUME_TOL ) ) { integrateVolumeToleranceG = 50.0F; } @@ -1685,7 +1680,7 @@ F32 integrateVolumeToleranceG = WET_SELF_TEST_INTEGRATED_VOLUME_TOLERANCE; #ifndef _RELEASE_ - if ( SW_CONFIG_ENABLE_VALUE == getSoftwareConfigStatus( SW_CONFIG_ENABLE_DVT_ARTERIAL_PRESSURE_SENSOR ) ) + if ( SW_CONFIG_ENABLE_VALUE == getSoftwareConfigStatus( SW_CONFIG_ENABLE_WET_SELF_TEST_WIDER_VOLUME_TOL ) ) { integrateVolumeToleranceG = 50.0F; } @@ -1726,16 +1721,19 @@ * @brief * The handleWetSelfTestStoppedState function handles the stopped wet self-tests * operation. - * @details Inputs: none - * @details Outputs: none + * @details Inputs: selfTestsResumeRequested + * @details Outputs: selfTestsResumeRequested * @return the next state of wet self-tests state machine *************************************************************************/ static WET_SELF_TESTS_STATE_T handleWetSelfTestStoppedState( void ) { WET_SELF_TESTS_STATE_T state = WET_SELF_TESTS_STOPPED_STATE; + doorClosedRequired( FALSE, FALSE ); + if ( TRUE == selfTestsResumeRequested ) { + doorClosedRequired( TRUE, TRUE ); selfTestsResumeRequested = FALSE; state = WET_SELF_TESTS_START_STATE; }