Index: firmware/App/Modes/ModeFill.c =================================================================== diff -u -r2de5552645e060e73d186ffb5a20223f163d4673 -r4b528a5706b6d1c8661b00dcd45c39cf8db9a0f6 --- firmware/App/Modes/ModeFill.c (.../ModeFill.c) (revision 2de5552645e060e73d186ffb5a20223f163d4673) +++ firmware/App/Modes/ModeFill.c (.../ModeFill.c) (revision 4b528a5706b6d1c8661b00dcd45c39cf8db9a0f6) @@ -8,7 +8,7 @@ * @file ModeFill.c * * @author (last) Dara Navaei -* @date (last) 16-Aug-2023 +* @date (last) 18-Aug-2023 * * @author (original) Leonardo Baloa * @date (original) 19-Nov-2019 @@ -146,6 +146,7 @@ static U32 pumpSpeedIndex; ///< Index used to access the desired pump speed in roPumpFlushBubblesSpeed table. static BOOL havePauseActuatorsBeenSet; ///< Flag to indicate the actuators have been set to pause for the first time. +static BOOL didFillRecoverFromPause; ///< Flag to indicate whether the previous state was pause or not. static FILL_ACID_BICARB_TYPES_T chemicalsTypes; ///< Chemicals Types (acid and bicarb). static DG_CHEMICALS_FILL_COND_CAL_RECORD_T chemicalsCond; ///< Chemicals fill conductivity records. static F32 acidMixRatio; ///< Acid conductivity mix ratio. @@ -218,6 +219,7 @@ sumFillCPoConductivity = 0.0F; sumFillRejRatio = 0.0F; fillCPoConductivitySampleCnt = 0; + didFillRecoverFromPause = FALSE; } /*********************************************************************//** @@ -967,7 +969,7 @@ * The handlePausedState function executes the paused state of the fill * mode state machine. * @details Inputs: havePauseActuatorsBeenSet - * @details Outputs: havePauseActuatorsBeenSet + * @details Outputs: havePauseActuatorsBeenSet, didFillRecoverFromPause * @return the next state *************************************************************************/ static DG_FILL_MODE_STATE_T handlePausedState( void ) @@ -978,6 +980,7 @@ if ( ( FALSE == areInletWaterConditionsAlarmsActive() ) && ( FALSE == areConductivityAlarmsActive() ) ) { + didFillRecoverFromPause = TRUE; havePauseActuatorsBeenSet = FALSE; result = DG_FILL_MODE_STATE_TEST_INLET_WATER; } @@ -989,11 +992,12 @@ * @brief * The setModeFillStateTransition function sets the actuators and variables * for the state transition in mode fill. - * @details Inputs: pumpSpeedIndex, havePauseActuatorsBeenSet + * @details Inputs: pumpSpeedIndex, havePauseActuatorsBeenSet, + * didFillRecoverFromPause * @details Outputs: concPumpPrimeStartTimeMS, fillStatus, pumpSpeedIndex, * concentratePrimingStartTime, totalBicarbConductivity, averageBicarbConductivity, * bicarbConductivitySampleCount, concentrateTestStartTime, fillStatus, - * havePauseActuatorsBeenSet, flushBubblesStartTime + * havePauseActuatorsBeenSet, flushBubblesStartTime, didFillRecoverFromPause * @param state mode fill state enum * @return none *************************************************************************/ @@ -1067,7 +1071,11 @@ case DG_FILL_MODE_STATE_DELIVER_DIALYSATE: setValveState( VPO, VALVE_STATE_FILL_C_TO_NC ); - dialysateFillStartTimeMS = getMSTimerCount(); + if ( didFillRecoverFromPause != TRUE ) + { + dialysateFillStartTimeMS = getMSTimerCount(); + } + didFillRecoverFromPause = FALSE; fillStatus.isThisFirstFill = FALSE; break;