Index: firmware/App/Modes/ModePreTreat.c =================================================================== diff -u -r4a369538d8e96eada94bc74da213c54c33107426 -r18ff3484c0eb42b22197d86312013196ab79584c --- firmware/App/Modes/ModePreTreat.c (.../ModePreTreat.c) (revision 4a369538d8e96eada94bc74da213c54c33107426) +++ firmware/App/Modes/ModePreTreat.c (.../ModePreTreat.c) (revision 18ff3484c0eb42b22197d86312013196ab79584c) @@ -46,9 +46,9 @@ /// TODO: Restore to 100 when DPi flow control is fixed. #define DIP_PATIENT_CONNECTION_FLOW_RATE_ML_MIN 250 ///< Patient connection sub-mode dialysate inlet pump flow rate in mL/min. -#define PRE_TREATMENT_MIN_RESERVOIR_VOLUME_ML 400 ///< Fill reservoir to this volume minimum to prep volume during development. +#define PRE_TREATMENT_MIN_FILL_RESERVOIR_VOLUME_ML 125 ///< Fill reservoir to this volume minimum to prep volume during development. #define PRE_TREATMENT_FLUSH_RESERVOIR_VOLUME_ML 500 ///< Fill reservoir to this volume (in mL) to flush filter and lines. -#define PRE_TREATMENT_FILL_RESERVOIR_ONE_VOLUME_ML 1200 ///< Fill reservoir one to this volume (in mL) during pre-treatment mode. +#define PRE_TREATMENT_FILL_RESERVOIR_ONE_VOLUME_ML 1200 ///< Fill reservoir one to this volume (in mL) during pre-treatment mode, prep for wet test. #define PRE_TREATMENT_FILL_RESERVOIR_TWO_VOLUME_ML 600 ///< Fill reservoir two to this volume (in mL) during pre-treatment mode. #define PRE_TREATMENT_FULL_RESERVOIR_VOLUME_ML 1500 ///< Fill reservoir to this volume minimum to prep volume during development. @@ -1087,34 +1087,35 @@ DG_OP_MODE_T dgOpMode = getDGOpMode(); U32 dgSubMode = getDGSubMode(); U32 volume = 0; + DG_RESERVOIR_ID_T inactiveReservoir = getDGInactiveReservoir(); if ( ( DG_MODE_GENE == dgOpMode ) && ( DG_GEN_IDLE_MODE_STATE_FLUSH_WATER == dgSubMode ) ) { // Drain both reservoirs and return to active res 2 before initial fills - if ( reservoirStatus[ activeReservoir ].initialDrain != TRUE ) + if ( reservoirStatus[ inactiveReservoir ].initialDrain != TRUE ) { - reservoirStatus[ activeReservoir ].initialDrain = TRUE; + reservoirStatus[ inactiveReservoir ].initialDrain = TRUE; state = PRE_TREATMENT_RESERVOIR_MGMT_REQUEST_RESERVOIR_SWITCH_STATE; } // Once both reservoirs drained and returned to active res 2, wait for pre-tx workflow // to get to point where fills are allowed, before starting fill // not flushed and need to fill -OR- // flushed and need to fill after entering dry self test state - else if ( ( TRUE == reservoirStatus[ activeReservoir ].startFlushFill ) || - ( ( TRUE == reservoirStatus[ activeReservoir ].startNormalFill ) && + else if ( ( TRUE == reservoirStatus[ inactiveReservoir ].startFlushFill ) || + ( ( TRUE == reservoirStatus[ inactiveReservoir ].startNormalFill ) && ( currentPreTreatmentState >= HD_PRE_TREATMENT_SELF_TEST_DRY_STATE ) ) ) { // Start tracking flush cycles, flushComplete => don't drain again. - if ( FALSE == reservoirStatus[ activeReservoir ].flushComplete ) + if ( FALSE == reservoirStatus[ inactiveReservoir ].flushComplete ) { - if (0 < reservoirStatus[ activeReservoir ].flushCount) + if (0 < reservoirStatus[ inactiveReservoir ].flushCount) { - reservoirStatus[ activeReservoir ].flushCount -= 1; + reservoirStatus[ inactiveReservoir ].flushCount -= 1; } - if ( 0 == reservoirStatus[ activeReservoir ].flushCount ) + if ( 0 == reservoirStatus[ inactiveReservoir ].flushCount ) { - reservoirStatus[ activeReservoir ].flushComplete = TRUE; + reservoirStatus[ inactiveReservoir ].flushComplete = TRUE; } } @@ -1278,14 +1279,32 @@ // Fill volumes after flushing if ( TRUE == reservoirStatus[ inactiveRes ].flushComplete ) { - if ( DG_RESERVOIR_1 == inactiveRes ) +#ifndef _RELEASE_ + if ( ( SW_CONFIG_ENABLE_VALUE == getSoftwareConfigStatus( SW_CONFIG_DISABLE_PRIMING ) ) || + ( SW_CONFIG_ENABLE_VALUE == getSoftwareConfigStatus( SW_CONFIG_DISABLE_WET_SELF_TEST ) ) ) { - volume = PRE_TREATMENT_FILL_RESERVOIR_ONE_VOLUME_ML; + if ( DG_RESERVOIR_1 == inactiveRes ) + { + volume = PRE_TREATMENT_FULL_RESERVOIR_VOLUME_ML; + } + // Reservoir 2 + else + { + volume = PRE_TREATMENT_MIN_FILL_RESERVOIR_VOLUME_ML; + } } - // Reservoir 2 else +#endif { - volume = PRE_TREATMENT_FILL_RESERVOIR_TWO_VOLUME_ML; + if ( DG_RESERVOIR_1 == inactiveRes ) + { + volume = PRE_TREATMENT_FILL_RESERVOIR_ONE_VOLUME_ML; + } + // Reservoir 2 + else + { + volume = PRE_TREATMENT_FILL_RESERVOIR_TWO_VOLUME_ML; + } } } // Flush fill volumes