Index: firmware/App/Controllers/DialInFlow.c =================================================================== diff -u -rdd1a9a6f5e43a5da27f4d51f56388f7d019cc43d -recfe9ec722ad63e9db99cb3fd6c2843693d058a4 --- firmware/App/Controllers/DialInFlow.c (.../DialInFlow.c) (revision dd1a9a6f5e43a5da27f4d51f56388f7d019cc43d) +++ firmware/App/Controllers/DialInFlow.c (.../DialInFlow.c) (revision ecfe9ec722ad63e9db99cb3fd6c2843693d058a4) @@ -398,6 +398,21 @@ return isDialInPumpOn; } +/*********************************************************************//** + * @brief + * The isDialInPumpRampComplete function returns whether the dialysate inlet pump has + * completed its ramp up and entered control state (closed or open loop). + * @details Inputs: dialInPumpState + * @details Outputs: none + * @return TRUE if pump is in control state, FALSE if not + *************************************************************************/ +BOOL isDialInPumpRampComplete( void ) +{ + BOOL result = ( DIAL_IN_PUMP_CONTROL_TO_TARGET_STATE == dialInPumpState ? TRUE : FALSE ); + + return result; +} + /*********************************************************************//** * @brief * The execDialInFlowMonitor function executes the dialIn flow monitor. @@ -417,18 +432,22 @@ { dipFlow = getDGDialysateFlowRateLMin() * (F64)ML_PER_LITER; // convert rate to mL/min filterDialInFlowReadings( dipFlow ); // process the fresh dialysate flow data - dialysateFlowDataFreshStatusCounter = 0; // reset counter + dialysateFlowDataFreshStatusCounter = 0; } else { // Alarm if not receiving new dialysate flow readings in timely manner - if ( ++dialysateFlowDataFreshStatusCounter > DIP_DIALYSATE_FLOW_DATA_ALARM_THRESHOLD ) + if ( TRUE == isDGCommunicating() ) { - filterDialInFlowReadings( 0.0 ); - if ( TRUE == isDGCommunicating() ) + if ( ++dialysateFlowDataFreshStatusCounter > DIP_DIALYSATE_FLOW_DATA_ALARM_THRESHOLD ) { + filterDialInFlowReadings( 0.0 ); activateAlarmNoData( ALARM_ID_HD_DIALYSATE_FLOW_DATA_NOT_RECEIVE ); } } + else + { + dialysateFlowDataFreshStatusCounter = 0; + } } // Get latest pump speed and current from motor controller