Index: firmware/App/Modes/SelfTests.c =================================================================== diff -u -r64f6bd52b1c84609e1920810b32722f0ce4f4e60 -rd2ed8abbf72279455b1121aee74f286eb27453dd --- firmware/App/Modes/SelfTests.c (.../SelfTests.c) (revision 64f6bd52b1c84609e1920810b32722f0ce4f4e60) +++ firmware/App/Modes/SelfTests.c (.../SelfTests.c) (revision d2ed8abbf72279455b1121aee74f286eb27453dd) @@ -7,8 +7,8 @@ * * @file SelfTests.c * -* @author (last) Sean Nash -* @date (last) 20-Jul-2023 +* @author (last) James Walter Taylor +* @date (last) 26-Jul-2023 * * @author (original) Quang Nguyen * @date (original) 28-Jan-2021 @@ -1683,17 +1683,29 @@ if ( BUBBLE_NOT_DETECTED == ADVBubbleStatus ) { - if ( TRUE == zeroBloodLeak() ) + if ( FALSE == isAlarmActive( ALARM_ID_HD_PRE_TREATMENT_WET_PRIME_TEST_FAILURE ) ) { - state = WET_SELF_TESTS_BLOOD_LEAK_DETECTOR_STATE; + if ( TRUE == zeroBloodLeak() ) + { + state = WET_SELF_TESTS_BLOOD_LEAK_DETECTOR_STATE; // all is good to go to the next state + } } + else + { // Stick in this state, until bubbles no longer detected/Alarm cleared + if ( STATE_CLOSED == getSwitchStatus( PUMP_TRACK_SWITCH ) ) // Spurious bubble alarms occur when the cartridge is disturbed (unlatched) + { + clearAlarmCondition( ALARM_ID_HD_PRE_TREATMENT_WET_PRIME_TEST_FAILURE ); + } + } } else { - activateAlarmNoData( ALARM_ID_HD_PRE_TREATMENT_WET_PRIME_TEST_FAILURE ); + if ( STATE_CLOSED == getSwitchStatus( PUMP_TRACK_SWITCH ) ) + { + activateAlarmNoData( ALARM_ID_HD_PRE_TREATMENT_WET_PRIME_TEST_FAILURE ); + } } - - if ( TRUE == doesAlarmStatusIndicateStop() ) + if ( TRUE == doesAlarmStatusIndicateStop() ) // WET_PRIME_TEST_FAILURE will force the self-tests to stop { checkpointWetSelfTestsState = WET_SELF_TESTS_PRIME_CHECK_STATE; state = WET_SELF_TESTS_STOPPED_STATE; @@ -2114,6 +2126,13 @@ if ( TRUE == selfTestsResumeRequested ) { + if ( BUBBLE_NOT_DETECTED == getBubbleStatus( ADV ) ) + { + if ( STATE_CLOSED == getSwitchStatus( PUMP_TRACK_SWITCH ) ) // Spurious bubble alarms occur when the cartridge is disturbed (unlatched) + { + clearAlarmCondition( ALARM_ID_HD_PRE_TREATMENT_WET_PRIME_TEST_FAILURE ); + } + } // Restart self-test start time selfTestStartTime = getMSTimerCount(); doorClosedRequired( TRUE, TRUE );