Index: firmware/App/Controllers/DGInterface.c =================================================================== diff -u -r78c03fb021407eaf8d17dd0f74f6969443b397ce -r30f049651877229042e3f8700c8596e5b9a1e0f4 --- firmware/App/Controllers/DGInterface.c (.../DGInterface.c) (revision 78c03fb021407eaf8d17dd0f74f6969443b397ce) +++ firmware/App/Controllers/DGInterface.c (.../DGInterface.c) (revision 30f049651877229042e3f8700c8596e5b9a1e0f4) @@ -57,9 +57,9 @@ static BOOL dgTrimmerHeaterOn = FALSE; ///< Flag indicates whether we've commanded the DG to start or stop the trimmer heater. static BOOL dgWaterSampled = FALSE; ///< Flag indicates whether we've commanded the DG to sample water. -// state machine states +// State machine states static TREATMENT_RESERVOIR_MGMT_STATE_T currentTrtResMgmtState = TREATMENT_RESERVOIR_MGMT_START_STATE; ///< Current state of treatment mode reservoir management. -static U32 resMgmtTimer = 0; ///< used for keeping state time. +static U32 resMgmtTimer = 0; ///< Used for keeping state time. // DG sensor data static F32 dgPressures[ NUM_OF_DG_PRESSURE_SENSORS ]; ///< Latest pressures reported by the DG. @@ -82,7 +82,7 @@ static U32 dgReservoirFillVolumeTargetSet = 0; ///< Fill-to volume commanded. static U32 dgReservoirDrainVolumeTarget = 0; ///< Latest drain-to volume reported by the DG. static U32 dgReservoirDrainVolumeTargetSet = 0; ///< Drain-to volume commanded. -static U32 resUseTimer = 0; ///< used to track time pumping from active reservoir (for volume used calculation). +static U32 resUseTimer = 0; ///< Used to track time pumping from active reservoir (for volume used calculation). static F32 resUseVolumeMl = 0.0; ///< Accumulated volume used from active reservoir. static BOOL resHasBeenTared[ NUM_OF_DG_RESERVOIRS ]; ///< Flags indicate whether the reservoir has been tared for this treatment. @@ -175,7 +175,7 @@ } resUseTimer = getMSTimerCount(); - // treatment reservoir mgmt. state machine + // Treatment reservoir mgmt. state machine switch ( currentTrtResMgmtState ) { case TREATMENT_RESERVOIR_MGMT_START_STATE: @@ -208,7 +208,7 @@ break; case TREATMENT_RESERVOIR_MGMT_WAIT_TO_FILL_STATE: - // delay fill start if we've paused treatment? + // Delay fill start if we've paused treatment? if ( getTreatmentState() == TREATMENT_DIALYSIS_STATE ) { if ( DG_MODE_CIRC == dgOpMode ) @@ -246,21 +246,21 @@ case TREATMENT_RESERVOIR_MGMT_WAIT_FOR_RES_SWITCH_STATE: // Reservoir switch during treatment should only occur in this state (i.e. when DG is ready). - // switch reservoirs when active reservoir is spent (i.e. we've pumped fill volume through dialyzer) and DG ready + // Switch reservoirs when active reservoir is spent (i.e. we've pumped fill volume through dialyzer) and DG ready if ( ( DG_MODE_CIRC == getDGOpMode() ) && ( DG_RECIRCULATE_MODE_STATE_RECIRC_WATER == getDGSubMode() ) && ( resUseVolumeMl >= (F32)dgReservoirFillVolumeTargetSet ) ) { DG_RESERVOIR_ID_T activeRes = dgActiveReservoirSet; DG_RESERVOIR_ID_T inactiveRes = ( activeRes == DG_RESERVOIR_1 ? DG_RESERVOIR_2 : DG_RESERVOIR_1 ); - // signal dialysis sub-mode to capture baseline volume for next reservoir. + // Signal dialysis sub-mode to capture baseline volume for next reservoir. setStartReservoirVolume(); // Command DG to switch reservoirs cmdSetDGActiveReservoir( inactiveRes ); - // signal dialysis sub-mode to switch reservoirs + // Signal dialysis sub-mode to switch reservoirs signalReservoirsSwitched(); resUseVolumeMl = 0.0; - // wait for used reservoir to settle + // Wait for used reservoir to settle resMgmtTimer = getMSTimerCount(); currentTrtResMgmtState = TREATMENT_RESERVOIR_MGMT_WAIT_FOR_SWITCH_SETTLE_STATE; } @@ -269,7 +269,7 @@ case TREATMENT_RESERVOIR_MGMT_WAIT_FOR_SWITCH_SETTLE_STATE: if ( TRUE == didTimeout( resMgmtTimer, RESERVOIR_SETTLE_TIME_MS ) ) { - // signal dialysis sub-mode to capture final volume of prior reservoir after settling. + // Signal dialysis sub-mode to capture final volume of prior reservoir after settling. setFinalReservoirVolume(); // Reset to start state to restart drain, fill, switch process. currentTrtResMgmtState = TREATMENT_RESERVOIR_MGMT_START_STATE;