Index: firmware/App/Modes/ModeFlush.c =================================================================== diff -u -r1a7b3fdc8c9b47ae713a7ec37670a96df7d73818 -r34ed52c598042fdcfa5526e3b1d46fa09b040199 --- firmware/App/Modes/ModeFlush.c (.../ModeFlush.c) (revision 1a7b3fdc8c9b47ae713a7ec37670a96df7d73818) +++ firmware/App/Modes/ModeFlush.c (.../ModeFlush.c) (revision 34ed52c598042fdcfa5526e3b1d46fa09b040199) @@ -278,8 +278,8 @@ * The handleFlushModeStartState function handles the flush start state. * If the sensors are in range, it transitions to the next state otherwise, * it transitions to basic cancellation state. - * @details Inputs: stateTimer, rsrvr1Status - * @details Outputs: stateTimer, rsrvr1Status + * @details Inputs: stateTimerStart, rsrvr1Status + * @details Outputs: stateTimerStart, rsrvr1Status * @return next state of the flush state machine *************************************************************************/ static DG_FLUSH_STATE_T handleFlushModeStartState( void ) @@ -311,8 +311,8 @@ * The handleFlushModeDrainR1State function handles the drain reservoir 1. * If the drain is completed within the defined time, it transitions to the * next state, otherwise, it transitions to basic cancellation state. - * @details Inputs: stateTimer, rsrvr1Status,rsrvr2Status, isThisInitialDrain - * @details Outputs: stateTimer, rsrvr1Status, rsrvr2Status + * @details Inputs: stateTimerStart, rsrvr1Status,rsrvr2Status, isThisInitialDrain + * @details Outputs: stateTimerStart, rsrvr1Status, rsrvr2Status * @return next state of the flush state machine *************************************************************************/ static DG_FLUSH_STATE_T handleFlushModeDrainR1State( void ) @@ -352,8 +352,8 @@ * The handleFlushModeDrainR2State function handles the drain reservoir 2. * If the drain is completed within the defined time, it transitions to the * next state, otherwise, it transitions to basic cancellation state. - * @details Inputs: stateTimer, rsrvr1Status, rsrvr2Status, isThisInitialDrain - * @details Outputs: stateTimer, rsrvr1Status, rsrvr2Status + * @details Inputs: stateTimerStart, rsrvr1Status, rsrvr2Status, isThisInitialDrain + * @details Outputs: stateTimerStart, rsrvr1Status, rsrvr2Status * @return next state of the flush state machine *************************************************************************/ static DG_FLUSH_STATE_T handleFlushModeDrainR2State( void ) @@ -403,8 +403,8 @@ * @brief * The handleFlushModeFlushDrainState function handles the flush drain state. * Once the flush drain time has elapsed, it transitions to the next state. - * @details Inputs: stateTimer - * @details Outputs: stateTimer + * @details Inputs: stateTimerStart + * @details Outputs: stateTimerStart * @return next state of the flush state machine *************************************************************************/ static DG_FLUSH_STATE_T handleFlushModeFlushDrainState( void ) @@ -433,8 +433,8 @@ * The handleFlushModeFlushDialysateState function handles the flush * dialysate state. Once the flush dialysate time has elapsed, it * transitions to the next state. - * @details Inputs: stateTimer - * @details Outputs: stateTimer + * @details Inputs: stateTimerStart + * @details Outputs: stateTimerStart * @return next state of the flush state machine *************************************************************************/ static DG_FLUSH_STATE_T handleFlushModeFlushDialysateState( void ) @@ -457,8 +457,8 @@ * The handleFlushModeFlushDialysateState function handles the flush * dialysate state. Once the flush dialysate time has elapsed, it * transitions to the next state. - * @details Inputs: rsrvr1Status, rsrvr2Status, stateTimer - * @details Outputs: rsrvr1Status, rsrvr2Status, stateTimer + * @details Inputs: rsrvr1Status, rsrvr2Status, stateTimerStart + * @details Outputs: rsrvr1Status, rsrvr2Status, stateTimerStart * @return next state of the flush state machine *************************************************************************/ static DG_FLUSH_STATE_T handleFlushModeFlushConcentrateStrawsState( void ) @@ -489,9 +489,9 @@ * it transitions to water cancellation state. If reservoir 2 is filled to * 500 mL before reservoir 1 is filled, it transitions to water cancellation * state. - * @details Inputs: rsrvr1Status, rsrvr2Status, stateTimer - * @details Outputs: rsrvr1Status, rsrvr2Status, stateTimer, prevFlushState, - * alarmDetectedPendingTrigger + * @details Inputs: rsrvr1Status, rsrvr2Status, stateTimerStart + * @details Outputs: rsrvr1Status, rsrvr2Status, stateTimerStart, + * prevFlushState, alarmDetectedPendingTrigger * @return next state of the flush state machine *************************************************************************/ static DG_FLUSH_STATE_T handleFlushModeFlushR1ToR2State( void ) @@ -558,9 +558,9 @@ * out the function transitions to basic cancellation state. If reservoir 1 * is filled to 500 mL before reservoir 2 is filled, it transitions to * water cancellation state. - * @details Inputs: rsrvr1Status, rsrvr2Status, stateTimer - * @details Outputs: rsrvr1Status, rsrvr2Status, stateTimer, prevFlushState, - * alarmDetectedPendingTrigger, isThisInitialDrain + * @details Inputs: rsrvr1Status, rsrvr2Status, stateTimerStart + * @details Outputs: rsrvr1Status, rsrvr2Status, stateTimerStart, + * prevFlushState, alarmDetectedPendingTrigger, isThisInitialDrain * @return next state of the flush state machine *************************************************************************/ static DG_FLUSH_STATE_T handleFlushModeFlushR2AndDrainR1State( void ) @@ -814,6 +814,10 @@ if ( DG_RESERVOIR_REACHED_TARGET == rsrvr1Status ) { + // Done with draining + signalDrainPumpHardStop(); + + // Raise the alarm failFlushMode(); } }