Index: firmware/App/Controllers/DGInterface.c =================================================================== diff -u -rf760ffc4b10556e5186e9ceb90294262063440ca -r270b4665c25617158ef06c1819debfb5bd59a942 --- firmware/App/Controllers/DGInterface.c (.../DGInterface.c) (revision f760ffc4b10556e5186e9ceb90294262063440ca) +++ firmware/App/Controllers/DGInterface.c (.../DGInterface.c) (revision 270b4665c25617158ef06c1819debfb5bd59a942) @@ -79,7 +79,8 @@ static F32 lgLoadCellBackupReadingsTotal[ NUM_OF_DG_RESERVOIRS ]; ///< Rolling total - used to calc large load cell moving average. // DG Dialysate flow rate -static F32 dgDialysateFlowRateMlMin = 0.0; ///< Latest dialysate flow rate reported by the DG. +static F32 dgDialysateFlowRateLMin; ///< Latest dialysate flow rate (in L/min) reported by the DG. +static F32 dgDialysateFlowRateRawLMin; ///< Latest raw dialysate flow rate (in L/min) reported by the DG. static BOOL dgDialysateFlowDataFreshFlag = FALSE; ///< Flag to signal the execDialInFlowMonitor() to process fresh flow rate data static BOOL dgLoadCellDataFreshFlag = FALSE; ///< Flag to signal the handleLoadCellReadingsFromDG() to process fresh load cell data static BOOL dgDialysateTemperatureDataFreshFlag = FALSE; ///< Flag to signal the handleTemperatureReadingsFromDG() to process fresh temperature data @@ -131,7 +132,8 @@ dgCurrentOpMode = DG_MODE_INIT; dgSubMode = 0; dgStartCommandSent = FALSE; - dgDialysateFlowRateMlMin = 0.0F; + dgDialysateFlowRateLMin = 0.0F; + dgDialysateFlowRateRawLMin = 0.0F; dgDialysateFlowDataFreshFlag = FALSE; dgHeatDisinfectTemp = 0.0F; @@ -309,19 +311,34 @@ * @brief * The getDGDialysateFlowRateLMin function gets the latest dialysate flow * rate reported by the DG. - * @details Inputs: dgDialysateFlowRateMlMin + * @details Inputs: dgDialysateFlowRateLMin * @details Outputs: none * @return Latest dialysate flow rate (in L/min) reported by DG. *************************************************************************/ F32 getDGDialysateFlowRateLMin( void ) { - F32 result = dgDialysateFlowRateMlMin; + F32 result = dgDialysateFlowRateLMin; return result; } /*********************************************************************//** * @brief + * The getDGRawDialysateFlowRateLMin function gets the latest raw dialysate flow + * rate reported by the DG. + * @details Inputs: dgDialysateFlowRateRawLMin + * @details Outputs: none + * @return Latest dialysate flow rate (in L/min) reported by DG. + *************************************************************************/ +F32 getDGRawDialysateFlowRateLMin( void ) +{ + F32 result = dgDialysateFlowRateRawLMin; + + return result; +} + +/*********************************************************************//** + * @brief * The getDialysateFlowDataFreshFlag function returns a flag to indicate * if the dialysate flow rate data reported by the DG is fresh or stale data. * @details Inputs: dgDialysateFlowDataFreshFlag @@ -569,19 +586,25 @@ * The setDialysateFlowData function sets the latest dialysate flow rate * and its freshness status. The dialysate flow data is reported by the DG. * @details Inputs: none - * @details Outputs: dgDialysateFlowRateMlMin, dgDialysateFlowDataFreshFlag - * @param flowRate latest dialysate flow rate (mL/min) reported by DG + * @details Outputs: dgDialysateFlowRateLMin, dgDialysateFlowRateRawLMin, + * dgDialysateFlowDataFreshFlag + * @param flowRates latest DG flow rates (mL/min) reported by DG * @return none *************************************************************************/ -void setDialysateFlowData( F32 flowRate ) +void setDialysateFlowData( FLOW_SENSORS_DATA_T flowRates ) { // Check if the sent value by DG is a NaN - if ( isnan( flowRate ) ) + if ( isnan( flowRates.dialysateFlowRateLPM ) ) { - flowRate = 0.0; + flowRates.dialysateFlowRateLPM = 0.0F; } + if ( isnan( flowRates.dialysateRawFlowRateLPM ) ) + { + flowRates.dialysateRawFlowRateLPM = 0.0F; + } - dgDialysateFlowRateMlMin = flowRate; + dgDialysateFlowRateLMin = flowRates.dialysateFlowRateLPM; + dgDialysateFlowRateRawLMin = flowRates.dialysateRawFlowRateLPM; dgDialysateFlowDataFreshFlag = TRUE; }