Index: firmware/App/Modes/Prime.c =================================================================== diff -u -ra37189e75de205982befcc91176f33c0523b03a8 -re63dcc4fa401c74ce82958f1dd4105fcf6fd1d60 --- firmware/App/Modes/Prime.c (.../Prime.c) (revision a37189e75de205982befcc91176f33c0523b03a8) +++ firmware/App/Modes/Prime.c (.../Prime.c) (revision e63dcc4fa401c74ce82958f1dd4105fcf6fd1d60) @@ -8,7 +8,7 @@ * @file Prime.c * * @author (last) Sean Nash -* @date (last) 03-Jun-2023 +* @date (last) 12-Jun-2023 * * @author (original) Quang Nguyen * @date (original) 08-Dec-2020 @@ -137,7 +137,7 @@ static U32 primeDialysateBypassStartTime; ///< Starting time of priming dialysate bypass circuit. static U32 steadyVolumeSamplingStartTime; ///< Load cell steady volume sampling interval starting time. static F32 minimumReservoirVolume; ///< Minimum reservoir volume in mL. -static U32 steadyVolumeCount; ///< Use to keep track the number of dVolume/dt < Threshold. +static U32 steadyVolumeCount; ///< Use to keep track the number of dVolume/dt < Threshold static BOOL bubbleClearEnded; ///< Bubble clear ended boolean signal. // ********** private function prototypes ********** @@ -184,16 +184,14 @@ * The transitionToPrime function prepares for transition to prime sub-mode. * This function will reset anything required before the start of priming sequence. * @details Inputs: none - * @details Outputs: currentPrimeState, wetSelfTestsResult, - * primeStartReqReceived, reservoirFilledStatus[], bubbleClearEnded, - * primeDialyzerBubbleClearState + * @details Outputs: currentPrimeState, wetSelfTestsResult, primeStartReqReceived, + * reservoirFilledStatus[], bubbleClearEnded, primeDialyzerBubbleClearState * @return none *************************************************************************/ void transitionToPrime( void ) { primeStartTime = getMSTimerCount(); primeFirstPurgePass = TRUE; - primeDialyzerBubbleClearState = PRIME_BUBBLE_CLEAR_READY_STATE; setAlarmUserActionEnabled( ALARM_USER_ACTION_RESUME, TRUE ); setAlarmUserActionEnabled( ALARM_USER_ACTION_RINSEBACK, FALSE ); @@ -217,10 +215,13 @@ resetPrimeFlags(); - if ( TRUE == getTestConfigStatus( TEST_CONFIG_USE_WET_CARTRIDGE ) ) + if ( getTestConfigStatus( TEST_CONFIG_USE_WET_CARTRIDGE ) != TRUE ) { - // If the use wet cartridge test configuration has been enabled skip the dialyzer - // bubble clear + bubbleClearEnded = FALSE; + primeDialyzerBubbleClearState = PRIME_BUBBLE_CLEAR_READY_STATE; + } + else + { // if using a wet cartridge, we do not want to do the bubble clearing of dialyzer in blood side prime states bubbleClearEnded = TRUE; primeDialyzerBubbleClearState = PRIME_BUBBLE_CLEAR_COMPLETE_STATE; } @@ -599,7 +600,10 @@ purgeAirValvesBloodPumpControl(); purgeAirTimeOutStartTime = getMSTimerCount(); primeSalineDialyzerBubbleClearStartTime = getMSTimerCount(); - primeDialyzerBubbleClearState = PRIME_BUBBLE_CLEAR_READY_STATE; + if ( getTestConfigStatus( TEST_CONFIG_USE_WET_CARTRIDGE ) != TRUE ) + { + primeDialyzerBubbleClearState = PRIME_BUBBLE_CLEAR_READY_STATE; + } if ( TRUE == doesAlarmStatusIndicateStop() ) { @@ -610,7 +614,6 @@ return state; } - /*********************************************************************//** * @brief * The handlePrimePurgeAirState function checks for air trap level and moves @@ -994,6 +997,7 @@ if ( TRUE == isWetSelfTestsPassed() ) { + setCurrent4thLevelState( NO_SUB_STATE ); state = HD_PRIME_COMPLETE; } else if ( TRUE == doesAlarmStatusIndicateStop() )