Index: firmware/App/Monitors/Flow.c =================================================================== diff -u -r3edf8084a5028ee0d00a3fba496284e593e4254d -r6ebf16aefe8865d3ecca50348cabc3f42e676fb5 --- firmware/App/Monitors/Flow.c (.../Flow.c) (revision 3edf8084a5028ee0d00a3fba496284e593e4254d) +++ firmware/App/Monitors/Flow.c (.../Flow.c) (revision 6ebf16aefe8865d3ecca50348cabc3f42e676fb5) @@ -28,12 +28,12 @@ // ********** private definitions ********** -#define FLOWS_DATA_PUB_INTERVAL ( MS_PER_SECOND / TASK_PRIORITY_INTERVAL ) ///< Interval (ms/task time) at which the flows data is published on the CAN bus. -#define DATA_PUBLISH_COUNTER_START_COUNT ( 5 ) ///< Data publish counter start count. -#define FLOW_SAMPLE_FILTER_MS ( 500 ) ///< Filter flow data for given time -#define FLOW_TEMP_SAMPLE_FILTER_MS ( 500 ) ///< Filter flow temperature data for given time -#define SIZE_OF_FLOW_ROLLING_AVG ( FLOW_SAMPLE_FILTER_MS / TASK_PRIORITY_INTERVAL ) ///< Filtered flow moving average sample count. -#define SIZE_OF_FLOW_TEMP_ROLLING_AVG ( FLOW_TEMP_SAMPLE_FILTER_MS / TASK_PRIORITY_INTERVAL ) ///< Filtered flow temprature moving average sample count. +#define FLOWS_DATA_PUB_INTERVAL ( MS_PER_SECOND / TASK_PRIORITY_INTERVAL ) ///< Interval (ms/task time) at which the flows data is published on the CAN bus. +#define DATA_PUBLISH_COUNTER_START_COUNT ( 5 ) ///< Data publish counter start count. +#define FLOW_SAMPLE_FILTER_MS ( 500 ) ///< Filter flow data for given time +#define FLOW_TEMP_SAMPLE_FILTER_MS ( 500 ) ///< Filter flow temperature data for given time +#define SIZE_OF_FLOW_ROLLING_AVG ( FLOW_SAMPLE_FILTER_MS / TASK_PRIORITY_INTERVAL ) ///< Filtered flow moving average sample count. +#define SIZE_OF_FLOW_TEMP_ROLLING_AVG ( FLOW_TEMP_SAMPLE_FILTER_MS / TASK_PRIORITY_INTERVAL ) ///< Filtered flow temprature moving average sample count. /// Defined states for the flow monitor state machine. typedef enum FlowMonitor_States @@ -65,10 +65,10 @@ static OVERRIDE_F32_T filteredcurrentFlowReadings[ NUM_OF_FLOW_SENSORS ]; ///< filtered current flow sensor flow readings (overrideable). static OVERRIDE_F32_T filteredcurrentFlowTempReadings[ NUM_OF_FLOW_SENSORS ]; ///< filtered current flow sensor temperature readings (overrideable). -//static RO_PRES_SENSORS_CAL_RECORD_T flowsCalRecord; ///< Flows calibration record. +//static RO_PRES_SENSORS_CAL_RECORD_T flowsCalRecord; ///< Flows calibration record. -static FILTER_FLOW_READINGS_T filteredFlowReadings[NUM_OF_FLOW_SENSORS]; ///< Filtered flow reading for flow sensors. -static FILTER_FLOW_TEMPERATURE_READINGS_T filteredFlowTempReadings[NUM_OF_FLOW_SENSORS]; ///< Filtered temperature reading for flow sensors. +static FILTER_FLOW_READINGS_T filteredFlowReadings[NUM_OF_FLOW_SENSORS]; ///< Filtered flow reading for flow sensors. +static FILTER_FLOW_TEMPERATURE_READINGS_T filteredFlowTempReadings[NUM_OF_FLOW_SENSORS]; ///< Filtered temperature reading for flow sensors. static FLOW_STATE_T flowsState; ///< current state of flow monitor state machine. static U32 flowsDataPublicationTimerCounter; ///< used to schedule flow data publication to CAN bus. static OVERRIDE_U32_T flowsDataPublishInterval; ///< Flow data publish interval. @@ -138,10 +138,10 @@ *************************************************************************/ static void filterFlowSensors( void ) { - //Filter pressure sensor reading + //Filter flow sensor reading filterFlowSensorReadings(); - //Filter pressure sensor temperature reading + //Filter flow sensor temperature reading filterFlowSensorTemperatureReadings(); } @@ -309,7 +309,7 @@ * @param flow the flow rate before applying calibration to it * @return calibration applied flow rate *************************************************************************/ -//static F32 getCalibrationAppliedFlow( U08 sensorId, F32 pressure ) +//static F32 getCalibrationAppliedFlow( U08 sensorId, F32 flow ) //{ // F32 calFlow = pow( pressure, 4 ) * flowsCalRecord.flowSensors[ (FLOW_SENSORS_T)sensorId ].fourthOrderCoeff + // pow( pressure, 3 ) * flowsCalRecord.flowSensors[ (FLOW_SENSORS_T)sensorId ].thirdOrderCoeff +