Index: firmware/App/Modes/ModeFill.c =================================================================== diff -u -r750a8b61a1e9a63823ecc6ed441cd01524ffc02b -r95eefee71702fbf031025dc35ebaf553dfb050b7 --- firmware/App/Modes/ModeFill.c (.../ModeFill.c) (revision 750a8b61a1e9a63823ecc6ed441cd01524ffc02b) +++ firmware/App/Modes/ModeFill.c (.../ModeFill.c) (revision 95eefee71702fbf031025dc35ebaf553dfb050b7) @@ -143,7 +143,7 @@ static DG_FILL_MODE_STATE_T handleDeliverDialysateState( void ); static DG_FILL_MODE_STATE_T handlePausedState( void ); -static BOOL areInletWaterConditionsOutOfRange( void ); +static BOOL areInletWaterConditionsAlarmsActive( void ); static void checkDialysateTemperatureSensors( void ); static void handleDialysateMixing( F32 measuredROFlowRate_mL_min ); static void setFillInfoToRTCRAM( void ); @@ -238,7 +238,7 @@ activateAlarmNoData( ALARM_ID_DG_DIALYSATE_FILL_OUT_OF_TIME ); } - fillState = ( TRUE == areInletWaterConditionsOutOfRange() ? DG_FILL_MODE_STATE_PAUSED : fillState ); + fillState = ( TRUE == areInletWaterConditionsAlarmsActive() ? DG_FILL_MODE_STATE_PAUSED : fillState ); // Execute current Fill state switch ( fillState ) @@ -634,7 +634,6 @@ // Do the necessary setup here before transition to Produce Dialysate State fillStatus.isThisFirstFill = FALSE; result = DG_FILL_MODE_STATE_PRODUCE_DIALYSATE; - } #ifndef DISABLE_ACID_CONDUCTIVITY_TEST else @@ -784,36 +783,39 @@ havePauseActuatorsBeenSet = TRUE; } - if ( FALSE == areInletWaterConditionsOutOfRange() ) + if ( FALSE == areInletWaterConditionsAlarmsActive() ) { setValveState( VPO, VALVE_STATE_FILL_C_TO_NC ); havePauseActuatorsBeenSet = FALSE; result = DG_FILL_MODE_STATE_START; } - return result; } /*********************************************************************//** * @brief - * The areInletWaterConditionsOutOfRange function checks whether the inlet - * water conditions are in range. + * The areInletWaterConditionsAlarmsActive function checks whether the inlet + * water conditions are out of range and any of their alarms are active. * @details Inputs: none * @details Outputs: None - * @return TRUE if the inlet water conditions are in range otherwise, FALSE + * @return TRUE if any of the alarms are active, otherwise, FALSE *************************************************************************/ -static BOOL areInletWaterConditionsOutOfRange( void ) +static BOOL areInletWaterConditionsAlarmsActive( void ) { // Check inlet water conductivity, temperature, pressure, and RO rejection ratio - BOOL status = FALSE; - BOOL inletConductivityStatus = isInletWaterConductivityInRange(); - BOOL inletTemperatureStatus = isInletWaterTemperatureInRange(); - BOOL inletPressureStatus = isInletPressureInRange(); + BOOL status = FALSE; + checkInletWaterConductivity(); + checkInletWaterTemperature(); + checkInletWaterPressure(); - // If any of the inlet water conditions that are recoverable are not met, transition to pause mode - if ( ( FALSE == inletConductivityStatus ) || ( FALSE == inletTemperatureStatus ) || ( FALSE == inletPressureStatus ) ) + // Check if any of the alarms are active + if ( ( TRUE == isAlarmActive( ALARM_ID_INLET_WATER_CONDUCTIVITY_IN_LOW_RANGE ) ) || + ( TRUE == isAlarmActive( ALARM_ID_INLET_WATER_CONDUCTIVITY_IN_HIGH_RANGE ) ) || + ( TRUE == isAlarmActive( ALARM_ID_INLET_WATER_TEMPERATURE_IN_HIGH_RANGE ) ) || + ( TRUE == isAlarmActive( ALARM_ID_INLET_WATER_TEMPERATURE_IN_LOW_RANGE ) ) || + ( TRUE == isAlarmActive( ALARM_ID_INLET_WATER_PRESSURE_IN_LOW_RANGE ) ) ) { status = TRUE; }