Index: firmware/App/Modes/ModeFill.c =================================================================== diff -u -r73cebaf09d0f61be4d0d37642489b4763434994c -rbb25b54e08fa328452f5d6e3daa2c96578c296bb --- firmware/App/Modes/ModeFill.c (.../ModeFill.c) (revision 73cebaf09d0f61be4d0d37642489b4763434994c) +++ firmware/App/Modes/ModeFill.c (.../ModeFill.c) (revision bb25b54e08fa328452f5d6e3daa2c96578c296bb) @@ -197,8 +197,7 @@ DG_RESERVOIR_ID_T inactiveReservoir = getInactiveReservoir(); initFillMode(); - reservoirBaseWeight = getReservoirWeight( inactiveReservoir ); - dialysateFillStartTime = getMSTimerCount(); + reservoirBaseWeight = getReservoirWeight( inactiveReservoir ); // Set initial actuator states setValveState( VDR, VALVE_STATE_DRAIN_C_TO_NO ); @@ -229,13 +228,6 @@ checkRORejectionRatio(); checkDialysateTemperatureSensors(); - // TODO: Check for open straw door status and alarm if closed - // Check if run out of time to fill the reservoir - if ( TRUE == didTimeout( dialysateFillStartTime, DIALYSATE_FILL_TIME_OUT ) ) - { - activateAlarmNoData( ALARM_ID_DG_DIALYSATE_FILL_OUT_OF_TIME ); - } - fillState = ( TRUE == areInletWaterConditionsAlarmsActive() ? DG_FILL_MODE_STATE_PAUSED : fillState ); // Execute current Fill state @@ -682,6 +674,7 @@ { setValveState( VPO, VALVE_STATE_FILL_C_TO_NC ); + dialysateFillStartTime = getMSTimerCount(); fillStatus.isThisFirstFill = FALSE; result = DG_FILL_MODE_STATE_DELIVER_DIALYSATE; } @@ -722,6 +715,13 @@ setBadAvgConductivityDetectedFlag( FALSE ); + // TODO: Check for open straw door status and alarm if closed + // Check if run out of time to fill the reservoir + if ( TRUE == didTimeout( dialysateFillStartTime, DIALYSATE_FILL_TIME_OUT ) ) + { + activateAlarmNoData( ALARM_ID_DG_DIALYSATE_FILL_OUT_OF_TIME ); + } + // If we've reached our target fill to volume (by weight), we're done filling - go back to generation idle mode // SRSDG 398 if ( TRUE == hasTargetFillVolumeBeenReached( inactiveReservoir ) ) {