Index: firmware/App/Modes/ModeROPermeateSample.c =================================================================== diff -u -r8822f86705a24d1c7dd305b584a95ae3d3c406b8 -rac305d5eedc7fb0e85adef5cd4aa34e58e94e3b8 --- firmware/App/Modes/ModeROPermeateSample.c (.../ModeROPermeateSample.c) (revision 8822f86705a24d1c7dd305b584a95ae3d3c406b8) +++ firmware/App/Modes/ModeROPermeateSample.c (.../ModeROPermeateSample.c) (revision ac305d5eedc7fb0e85adef5cd4aa34e58e94e3b8) @@ -47,7 +47,7 @@ #define RSRVR_DRAIN_TARGET_RPM 2400 ///< Reservoir drain target RPM. #define RSRVR_MIX_DRAIN_TIMEOUT_MS ( 4 * SEC_PER_MIN * MS_PER_SECOND ) ///< Reservoirs 1 & 2 mix drain timeout in ms. #define RSRVR_FILL_TARGET_FILL_ML 1850.0F ///< Reservoir fill target in mL. -#define RSRVR_DRAIN_BEFORE_SAMPLE_COLLECTION_MS ( 0.25F * SEC_PER_MIN * MS_PER_SECOND ) //TODO 4.25 ///< Reservoir drain before collection samples in milliseconds. +#define RSRVR_DRAIN_BEFORE_SAMPLE_COLLECTION_MS ( 4.25F * SEC_PER_MIN * MS_PER_SECOND ) ///< Reservoir drain before collection samples in milliseconds. #define RO_PUMP_TARGET_DISPENSE_FLOW_RATE_LPM 0.4F ///< RO pump target flow rate during dispensing in L/min. #define TARGET_DISPENSE_VOLUME_ML 70.0F ///< Target dispense volume in milliliters. @@ -671,16 +671,21 @@ roPermeateSampleState = DG_RO_PERM_SAMPLE_STATE_CANCEL_WATER_PATH; alarmDetectedPendingTrigger = ( TRUE == isDialysateCapOpen ? ALARM_ID_DG_DIALYSATE_CAP_NOT_IN_PROPER_POSITION : ALARM_ID_DG_CONCENTRATE_CAP_NOT_IN_PROPER_POSITION ); + setROPermeateSampleStateTransition( roPermeateSampleState ); } break; } } - if ( ( TRUE == isDGFaultAlarmActive() ) && ( roPermeateSampleState != DG_RO_PERM_SAMPLE_STATE_CANCEL_WATER_PATH ) ) + if ( ( TRUE == isDGFaultAlarmActive() ) || ( TRUE == isAnyCleaningModeInletWaterConditionActive() ) ) { - // If there is any fault alarm and we are not already in the cancel water path state, set it to cancel water path state - roPermeateSamplePrevState = roPermeateSampleState; - roPermeateSampleState = DG_RO_PERM_SAMPLE_STATE_CANCEL_WATER_PATH; + if ( roPermeateSampleState != DG_RO_PERM_SAMPLE_STATE_CANCEL_WATER_PATH ) + { + // If there is any fault alarm and we are not already in the cancel water path state, set it to cancel water path state + roPermeateSamplePrevState = roPermeateSampleState; + roPermeateSampleState = DG_RO_PERM_SAMPLE_STATE_CANCEL_WATER_PATH; + setROPermeateSampleStateTransition( roPermeateSampleState ); + } } }