Index: firmware/App/Modes/ModeGenIdle.c =================================================================== diff -u -rc7ea3969643ead419cbfcd34c3cb203c45bcad71 -ra33ab8f72a09be4650026964dd2bd35ff95c8431 --- firmware/App/Modes/ModeGenIdle.c (.../ModeGenIdle.c) (revision c7ea3969643ead419cbfcd34c3cb203c45bcad71) +++ firmware/App/Modes/ModeGenIdle.c (.../ModeGenIdle.c) (revision a33ab8f72a09be4650026964dd2bd35ff95c8431) @@ -76,7 +76,7 @@ static DG_GEN_IDLE_MODE_BAD_FILL_STATE_T handleFirstDrainState( void ); static DG_GEN_IDLE_MODE_BAD_FILL_STATE_T handleFlushFillState( void ); static DG_GEN_IDLE_MODE_BAD_FILL_STATE_T handleSecondDrainState( void ); -static DG_GEN_IDLE_MODE_BAD_FILL_STATE_T handleRefillState( void ); +static DG_GEN_IDLE_MODE_BAD_FILL_STATE_T handleRefillState( DG_GEN_IDLE_MODE_STATE_T* idleState ); static void publishGenIdleSubstates(); @@ -280,7 +280,7 @@ * The handleBadFillState function executes the bad fill state of the * generation idle mode state machine. * @details Inputs: none - * @details Outputs: badFillState + * @details Outputs: badFillState, genIdleState * @return the next state *************************************************************************/ static DG_GEN_IDLE_MODE_STATE_T handleBadFillState( void ) @@ -307,7 +307,7 @@ break; case DG_HANDLE_BAD_FILL_STATE_REFILL: - badFillState = handleRefillState(); + badFillState = handleRefillState( &genIdleState ); break; default: @@ -405,16 +405,18 @@ * fill state machine. * @details Inputs: none * @details Outputs: none + * @param state pointer to the GenIdle main state machine to be processed * @return the next state *************************************************************************/ -static DG_GEN_IDLE_MODE_BAD_FILL_STATE_T handleRefillState( void ) +static DG_GEN_IDLE_MODE_BAD_FILL_STATE_T handleRefillState( DG_GEN_IDLE_MODE_STATE_T* idleState ) { DG_GEN_IDLE_MODE_BAD_FILL_STATE_T state = DG_HANDLE_BAD_FILL_STATE_START; // Clear wait for dialysate alarm condition to allow resume clearAlarmCondition( ALARM_ID_DG_CREATING_DIALYSATE_PLEASE_WAIT ); // resume option will appear // Set flag to FALSE here so next call to idle exec will move to normal flush water state handleBadFillFlag = FALSE; + *idleState = DG_GEN_IDLE_MODE_STATE_START; return state; }