Index: firmware/App/Modes/ModeGenIdle.c =================================================================== diff -u -rbc85a63a8b467a0d65328dfb689695590d5f2097 -rf248e95cb4a3187aee8d7e7ea773a0549ec7be30 --- firmware/App/Modes/ModeGenIdle.c (.../ModeGenIdle.c) (revision bc85a63a8b467a0d65328dfb689695590d5f2097) +++ firmware/App/Modes/ModeGenIdle.c (.../ModeGenIdle.c) (revision f248e95cb4a3187aee8d7e7ea773a0549ec7be30) @@ -9,7 +9,7 @@ * @file ModeGenIdle.c * * @author (last) Dara Navaei -* @date (last) 20-Apr-2023 +* @date (last) 04-May-2023 * * @author (original) Quang Nguyen * @date (original) 06-Aug-2021 @@ -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(); @@ -283,7 +283,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 ) @@ -310,7 +310,7 @@ break; case DG_HANDLE_BAD_FILL_STATE_REFILL: - badFillState = handleRefillState(); + badFillState = handleRefillState( &result ); break; default: @@ -407,18 +407,19 @@ * The handleRefillState function executes refill state of the handle bad * fill state machine. * @details Inputs: none - * @details Outputs: handleBadFillFlag, genIdleState + * @details Outputs: handleBadFillFlag + * @param idleState reference variable for the next idle state * @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; - genIdleState = DG_GEN_IDLE_MODE_STATE_START; + *idleState = DG_GEN_IDLE_MODE_STATE_START; return state; }