Index: firmware/App/Services/Reservoirs.c =================================================================== diff -u -r514463982373eb976e4b48a27d0f85f56e014920 -r687dc2717d2f6b128b73526791f08d7176e447e8 --- firmware/App/Services/Reservoirs.c (.../Reservoirs.c) (revision 514463982373eb976e4b48a27d0f85f56e014920) +++ firmware/App/Services/Reservoirs.c (.../Reservoirs.c) (revision 687dc2717d2f6b128b73526791f08d7176e447e8) @@ -74,7 +74,7 @@ static const F32 RESERVOIR_DILUTION_RATIO = MAX_RESERVOIR_DILUTION / ( 1.0 - MAX_RESERVOIR_DILUTION ); ///< Reservoir dilution ratio. // TODO remove -static BOOL test = FALSE; +static BOOL test = TRUE; // TODO remove // ********** private function prototypes ********** @@ -128,10 +128,6 @@ ratios.acidMixingRatio = 0.0; ratios.bicarbMixingRatio = 0.0; ratios.timeFillPrepMS = 0; - - // TODO remove - test = FALSE; - // TODO remove } /*********************************************************************//** @@ -583,29 +579,37 @@ TREATMENT_RESERVOIR_MGMT_STATE_T state = TREATMENT_RESERVOIR_MGMT_WAIT_FOR_FILL_SETTLE_STATE; // Wait for the reservoir to settle and then send the commands to switch the active reservoir - if ( ( TRUE == didTimeout( reservoirSwitchStartTimeMS, RESERVOIR_SETTLE_TIME_MS ) ) && ( volSpentML >= (F32)FILL_RESERVOIR_TO_VOLUME_ML ) /*&& ( FALSE == test )*/ ) // DEBUG_DENALI + if ( ( TRUE == didTimeout( reservoirSwitchStartTimeMS, RESERVOIR_SETTLE_TIME_MS ) ) && ( volSpentML >= (F32)FILL_RESERVOIR_TO_VOLUME_ML ) ) { DG_RESERVOIR_ID_T inactiveRes = getDGInactiveReservoir(); - // Signal dialysis sub-mode to capture baseline volume for next reservoir. - setStartReservoirVolume( inactiveRes ); + // TODO test code remove + // This must be TRUE for reservoir 1, and FALSE for reservoir 2 + test = FALSE; + //if ( TRUE == test ) + { + // Signal dialysis sub-mode to capture baseline volume for next reservoir. + setStartReservoirVolume( inactiveRes ); - // Command DG to switch reservoirs - cmdSetDGActiveReservoir( inactiveRes ); + // Command DG to switch reservoirs + cmdSetDGActiveReservoir( inactiveRes ); - // Signal dialysis sub-mode to switch reservoirs - signalReservoirsSwitched(); + // Signal dialysis sub-mode to switch reservoirs + signalReservoirsSwitched(); + } + // TODO test code // Get ready for the next delivery volSpentML = 0.0; // Wait for used reservoir to settle reservoirSwitchStartTimeMS = getMSTimerCount(); + // TODO test code state = TREATMENT_RESERVOIR_MGMT_WAIT_FOR_SWITCH_SETTLE_STATE; - - // This is to make sure the active reservoir stays as 2 - test = TRUE; + // For reservoir test, it should go back to start state + //state = TREATMENT_RESERVOIR_MGMT_START_STATE; + // TODO test code } return state;