Index: firmware/App/Modes/ModeFill.c =================================================================== diff -u -rebb9ab624960bcd1c09b6fc8def4654bb6f0cc3b -r4632ea37f1eabe4ee30524633eb24ccb6997ee98 --- firmware/App/Modes/ModeFill.c (.../ModeFill.c) (revision ebb9ab624960bcd1c09b6fc8def4654bb6f0cc3b) +++ firmware/App/Modes/ModeFill.c (.../ModeFill.c) (revision 4632ea37f1eabe4ee30524633eb24ccb6997ee98) @@ -160,6 +160,7 @@ static DG_FILL_MODE_STATE_T handlePausedState( void ); static BOOL areInletWaterConditionsAlarmsActive( void ); +static BOOL areConductivityAlarmsActive( void ); static void handleDialysateMixing( F32 measuredROFlowRate_mL_min, F32 acidMixingRatio, F32 bicarbMixingRatio ); static void setFillInfoToRTCRAM( void ); static BOOL isValueWithinPercentRange( F32 testValue, F32 baseValue, F32 percentFactor ); @@ -240,7 +241,10 @@ checkDialysateTemperatureSensors(); setHeaterTargetTemperature( DG_PRIMARY_HEATER, getPrimaryHeaterTargetTemperature() ); - fillState = ( TRUE == areInletWaterConditionsAlarmsActive() ? DG_FILL_MODE_STATE_PAUSED : fillState ); + if ( ( TRUE == areInletWaterConditionsAlarmsActive() ) || ( TRUE == areConductivityAlarmsActive() ) ) + { + fillState = DG_FILL_MODE_STATE_PAUSED; + } // Execute current Fill state switch ( fillState ) @@ -958,7 +962,7 @@ havePauseActuatorsBeenSet = TRUE; } - if ( FALSE == areInletWaterConditionsAlarmsActive() ) + if ( ( FALSE == areInletWaterConditionsAlarmsActive() ) && ( FALSE == areConductivityAlarmsActive() ) ) { havePauseActuatorsBeenSet = FALSE; result = DG_FILL_MODE_STATE_START; @@ -1001,6 +1005,27 @@ /*********************************************************************//** * @brief + * The areConductivityAlarmsActive function checks whether the inlet + * acid/bicarb conductivity alarms are active. + * @details Inputs: none + * @details Outputs: None + * @return TRUE if any of the alarms are active, otherwise, FALSE + *************************************************************************/ +static BOOL areConductivityAlarmsActive( void ) +{ + BOOL status = FALSE; + + if ( ( TRUE == isAlarmActive( ALARM_ID_BICARB_CONDUCTIVITY_OUT_OF_RANGE ) ) || + ( TRUE == isAlarmActive( ALARM_ID_ACID_CONDUCTIVITY_OUT_OF_RANGE ) ) ) + { + status = TRUE; + } + + return status; +} + +/*********************************************************************//** + * @brief * The isValueWithinPercentRange function validates if the test value * is within the percentage range specified by the baseValue and * percentFactor.