Index: firmware/App/Modes/ModeFill.c =================================================================== diff -u -r54e58f64179ea382d2e2c403c8c3b9a15a612636 -rd74b98a3b101ec827cc7da59dd617df9435d79e3 --- firmware/App/Modes/ModeFill.c (.../ModeFill.c) (revision 54e58f64179ea382d2e2c403c8c3b9a15a612636) +++ firmware/App/Modes/ModeFill.c (.../ModeFill.c) (revision d74b98a3b101ec827cc7da59dd617df9435d79e3) @@ -61,6 +61,9 @@ #define BICARB_CONCENTRATION_BOTTLE_VOLUME_ML 3000.0 ///< Volume of bicarb concentration in ml. #define CONCENTRATION_BOTTLE_LOW_VOLUME_ML 100.0 ///< Concentration bottle low volume in ml. +#define FLOW_MOVING_AVG_TIME_INTERVAL ( 1 * MS_PER_SECOND / TASK_GENERAL_INTERVAL ) ///< Fill flow moving average time interval. +#define NUMBER_OF_FLOW_SAMPLES_FOR_MOVING_AVG 10.0 ///< Number of flow samples to collect for moving average. + /// Multiplier to convert flow (mL/min) into volume (mL) for period of general task interval. static const F32 FLOW_INTEGRATOR = ( (F32)TASK_GENERAL_INTERVAL / (F32)( SEC_PER_MIN * MS_PER_SECOND ) ); @@ -74,7 +77,7 @@ static U32 concentrateTestStartTime; ///< Starting time for concentrate test. static U32 concentratePumpPrimeCount; ///< Interval count for concentrate pump prime. -static F32 totalROFlowRate_mL_min; ///< Total RO flow rate over period of time. +static F32 totalROFlowRate_mL_min; ///< Total RO flow rate over period of time. static F32 acidConductivityTotal; ///< Total of acid conductivity during fill. static F32 dialysateConductivityTotal; ///< Total of dialysate conductivity during fill. static U32 conductivitySampleCount; ///< Sample count of conductivity during fill.