Index: firmware/App/Modes/ModeGenIdle.c =================================================================== diff -u -r965a35a61959999274bbff47c74e439639d32b1d -r5857de39a15c4c373c853e0856a7d7f06665848e --- firmware/App/Modes/ModeGenIdle.c (.../ModeGenIdle.c) (revision 965a35a61959999274bbff47c74e439639d32b1d) +++ firmware/App/Modes/ModeGenIdle.c (.../ModeGenIdle.c) (revision 5857de39a15c4c373c853e0856a7d7f06665848e) @@ -256,8 +256,8 @@ * @brief * The handleIdleStartState function executes the start state of the * generation idle mode state machine. - * @details Inputs: none - * @details Outputs: none + * @details Inputs: handleEmptyBottleFlag + * @details Outputs: handleEmptyBottleFlag, handleBadFillFlag, badFillState * @return the next state *************************************************************************/ static DG_GEN_IDLE_MODE_STATE_T handleIdleStartState( void ) @@ -275,6 +275,8 @@ if ( ( TRUE == handleEmptyBottleFlag ) && ( DG_MODE_FILL == getPreviousOperationMode() ) ) { + // If the previous mode was fill and the empty bottle flag was TRUE, set it to FALSE and clear the informative alarm + // Done with the empty bottle handling handleEmptyBottleFlag = FALSE; clearAlarmCondition( ALARM_ID_DG_CREATING_DIALYSATE_PLEASE_WAIT ); } @@ -297,14 +299,15 @@ if ( ( TRUE == isAlarmActive( ALARM_ID_DG_ACID_BOTTLE_LOW_VOLUME ) ) || ( TRUE == isAlarmActive( ALARM_ID_DG_BICARB_BOTTLE_LOW_VOLUME ) ) ) { - // Empty bottle flag is TRUE and HD is on pause. So HD will not request a fill and it is - // commanded to fill. + // The empty bottle alarms are active set the empty bottle alarm to TRUE. handleEmptyBottleFlag = TRUE; } else if ( ( TRUE == handleEmptyBottleFlag ) && ( FALSE == isAlarmActive( ALARM_ID_DG_ACID_BOTTLE_LOW_VOLUME ) ) && ( FALSE == isAlarmActive( ALARM_ID_DG_BICARB_BOTTLE_LOW_VOLUME ) ) ) { + // The empty bottle flag is TRUE and alarms are not active anymore. This means the user has presumably inserted the new acid and + // bicarb bottles and has hit resume. Since HD is on pause, DG has to request fill by itself. requestNewOperationMode( DG_MODE_FILL ); }