Index: firmware/App/Controllers/ROPump.c =================================================================== diff -u -r8fe65bf6222137cc7182ccacff3a5f2fb2f03753 -r1e22b6ff6f42ddc57ad6c17e56057ab8a3765680 --- firmware/App/Controllers/ROPump.c (.../ROPump.c) (revision 8fe65bf6222137cc7182ccacff3a5f2fb2f03753) +++ firmware/App/Controllers/ROPump.c (.../ROPump.c) (revision 1e22b6ff6f42ddc57ad6c17e56057ab8a3765680) @@ -35,6 +35,7 @@ #include "TaskGeneral.h" #include "TaskPriority.h" #include "Timers.h" +#include "Valves.h" #ifdef EMC_TEST_BUILD #include "Heaters.h" #endif @@ -141,6 +142,7 @@ static DG_FLOW_SENSORS_CAL_RECORD_T flowSensorsCalRecord; ///< Flow sensors calibration record. static OVERRIDE_F32_T measuredROFlowRateWithConcPumpsLPM = { 0.0, 0.0, 0.0, 0 }; ///< Measure RO flow rate with concentrate pumps (L/min). static DG_RO_PUMP_CAL_RECORD_T roPumpCalRecord; ///< RO pump calibration record. +static F32 roVolumeL; ///< RO water generated in liters. // ********** private function prototypes ********** @@ -198,6 +200,7 @@ roPumpControlMode = NUM_OF_PUMP_CONTROL_MODES; isROPumpOn = FALSE; roPumpFeedbackDutyCyclePct = 0.0; + roVolumeL = 0.0; } /*********************************************************************//** @@ -379,6 +382,11 @@ flowFilterCounter = 0; } + if ( ( measuredROFlowRateLPM.data > NEARLY_ZERO ) && ( (U32)VALVE_STATE_CLOSED == getValveState( (U32)VBF ) ) ) + { + roVolumeL += ( measuredROFlowRateLPM.data * SEC_PER_MIN ); + } + #ifndef _RELEASE_ if ( getSoftwareConfigStatus( SW_CONFIG_DISABLE_RO_PUMP_MONITOR ) != SW_CONFIG_ENABLE_VALUE ) #endif @@ -574,6 +582,18 @@ /*********************************************************************//** * @brief + * The getROGeneratedVolumeL function returns the RO generated volume in liters. + * @details Inputs: none + * @details Outputs: none + * @return the RO generated volume in liters + *************************************************************************/ +F32 getROGeneratedVolumeL( void ) +{ + return roVolumeL; +} + +/*********************************************************************//** + * @brief * The handleROPumpOffState function handles the RO pump off state of the * controller state machine. * @details Inputs: roPumpControlMode, roPumpPWMDutyCyclePctSet,