Index: firmware/App/Services/Reservoirs.c =================================================================== diff -u -rc1715082687d81acb67b7d27bceedc648fc9b260 -r78e54600a3a75a87c32c49642df0a24c8da32186 --- firmware/App/Services/Reservoirs.c (.../Reservoirs.c) (revision c1715082687d81acb67b7d27bceedc648fc9b260) +++ firmware/App/Services/Reservoirs.c (.../Reservoirs.c) (revision 78e54600a3a75a87c32c49642df0a24c8da32186) @@ -643,34 +643,32 @@ dilutionLevelPct = volSpentUFML / (F32)FILL_RESERVOIR_TO_VOLUME_ML; // Wait for the reservoir to settle and then send the commands to switch the active reservoir - if ( TRUE == didTimeout( reservoirSwitchStartTimeMS, RESERVOIR_FRESH_SETTLE_TIME_MS ) ) + if ( TRUE == didTimeout( reservoirSwitchStartTimeMS, RESERVOIR_FRESH_SETTLE_TIME_MS ) && + ( ( dilutionLevelPct >= MAX_RESERVOIR_DILUTION ) || ( volSpentML >= (F32)FILL_RESERVOIR_TO_VOLUME_ML ) || ( getReservoirWeight( active ) > MAX_RESERVOIR_VOL_BEFORE_SWITCH_ML ) || TRUE == isDialysateTempAlarmActive() ) ) { DG_SWITCH_RSRVRS_CMD_T rsrvrCmd; DG_RESERVOIR_ID_T inactiveRes = getDGInactiveReservoir(); rsrvrCmd.reservoirID = (U32)inactiveRes; rsrvrCmd.useLastTrimmerHeaterDC = TRUE; - if ( ( dilutionLevelPct >= MAX_RESERVOIR_DILUTION ) || ( volSpentML >= (F32)FILL_RESERVOIR_TO_VOLUME_ML ) || - ( getReservoirWeight( active ) > MAX_RESERVOIR_VOL_BEFORE_SWITCH_ML ) || TRUE == isDialysateTempAlarmActive() ) - { - // Signal dialysis sub-mode to capture baseline volume for next reservoir. - setStartReservoirVolume( inactiveRes ); + // Signal dialysis sub-mode to capture baseline volume for next reservoir. + setStartReservoirVolume( inactiveRes ); - // Command DG to switch reservoirs - cmdSetDGActiveReservoir( &rsrvrCmd ); + // Command DG to switch reservoirs + cmdSetDGActiveReservoir( &rsrvrCmd ); - // Signal dialysis sub-mode to switch reservoirs - signalReservoirsSwitched(); + // Signal dialysis sub-mode to switch reservoirs + signalReservoirsSwitched(); - // Get ready for the next delivery - volSpentML = 0.0; + // Get ready for the next delivery + volSpentML = 0.0; - // Wait for used reservoir to settle - reservoirSwitchStartTimeMS = getMSTimerCount(); + // Wait for used reservoir to settle + reservoirSwitchStartTimeMS = getMSTimerCount(); - state = TREATMENT_RESERVOIR_MGMT_WAIT_FOR_SWITCH_SETTLE_STATE; - } + state = TREATMENT_RESERVOIR_MGMT_WAIT_FOR_SWITCH_SETTLE_STATE; + } return state;