Index: firmware/App/Monitors/Pressure.c =================================================================== diff -u -r364181b1c7ef0ae4d88a7bb0001a34e93fdb495f -r97ea48347859157d941d743deedb5b980b4c4594 --- firmware/App/Monitors/Pressure.c (.../Pressure.c) (revision 364181b1c7ef0ae4d88a7bb0001a34e93fdb495f) +++ firmware/App/Monitors/Pressure.c (.../Pressure.c) (revision 97ea48347859157d941d743deedb5b980b4c4594) @@ -31,9 +31,7 @@ #define PRESSURES_DATA_PUB_INTERVAL ( MS_PER_SECOND / TASK_PRIORITY_INTERVAL ) ///< Interval (ms/task time) at which the pressures data is published on the CAN bus. #define DATA_PUBLISH_COUNTER_START_COUNT ( 5 ) ///< Data publish counter start count. #define PRESSURE_SAMPLE_FILTER_MS ( 50 ) ///< Filter pressure data for given time -#define PRESSURE_TEMP_SAMPLE_FILTER_MS ( 50 ) -//#define PRESSURE_SAMPLE_FILTER_MS ( 200 ) ///< Filter pressure data for given time -//#define PRESSURE_TEMP_SAMPLE_FILTER_MS ( 200 ) ///< Filter temperature data for given time +#define PRESSURE_TEMP_SAMPLE_FILTER_MS ( 50 ) ///< Filter temperature data for given time #define SIZE_OF_PRESSURE_ROLLING_AVG ( PRESSURE_SAMPLE_FILTER_MS / TASK_PRIORITY_INTERVAL ) ///< Filtered pressure moving average. #define SIZE_OF_PRESSURETEMP_ROLLING_AVG ( PRESSURE_TEMP_SAMPLE_FILTER_MS / TASK_PRIORITY_INTERVAL ) ///< Filtered pressure temprature w/ 1 second moving average. #define MMHG_TO_PSI_CONVERSION 0.0193368F ///< MMHG to PSI conversion. @@ -54,42 +52,42 @@ /// Defined states for the pressures monitor state machine. typedef enum PresMonitor_States { - PRESSURE_INIT_STATE = 0, ///< Initialization state. - PRESSURE_CONTINUOUS_READ_STATE, ///< Continuous read sensors state. - NUM_OF_PRESSURE_STATES ///< Number of pressure monitor states. + PRESSURE_INIT_STATE = 0, ///< Initialization state. + PRESSURE_CONTINUOUS_READ_STATE, ///< Continuous read sensors state. + NUM_OF_PRESSURE_STATES ///< Number of pressure monitor states. } PRESSURE_STATE_T; /// Filter pressure reading. typedef struct { - F32 pressureReadings[ SIZE_OF_PRESSURE_ROLLING_AVG ]; ///< Holds pressure sample rolling average. - U32 pressureReadingsIdx; ///< Index for next sample in rolling average array. - F32 pressureReadingsTotal; ///< Rolling total - used to calc average. - U32 pressureReadingsCount; ///< Number of samples in rolling average buffer + F32 pressureReadings[ SIZE_OF_PRESSURE_ROLLING_AVG ]; ///< Holds pressure sample rolling average. + U32 pressureReadingsIdx; ///< Index for next sample in rolling average array. + F32 pressureReadingsTotal; ///< Rolling total - used to calc average. + U32 pressureReadingsCount; ///< Number of samples in rolling average buffer }FILTER_PRESSURE_READINGS_T; /// Filter pressuretemperature reading. typedef struct { - F32 pressureTempReadings[ SIZE_OF_PRESSURETEMP_ROLLING_AVG ]; ///< Holds pressure temperature sample rolling average. - U32 pressureTempReadingsIdx; ///< Index for next sample in rolling average array. - F32 pressureTempReadingsTotal; ///< Rolling total - used to calc average. - U32 pressureTempReadingsCount; ///< Number of samples in rolling average buffer + F32 pressureTempReadings[ SIZE_OF_PRESSURETEMP_ROLLING_AVG ]; ///< Holds pressure temperature sample rolling average. + U32 pressureTempReadingsIdx; ///< Index for next sample in rolling average array. + F32 pressureTempReadingsTotal; ///< Rolling total - used to calc average. + U32 pressureTempReadingsCount; ///< Number of samples in rolling average buffer }FILTER_PRESSURE_TEMPERATURE_READINGS_T; // ********** private data ********** -static OVERRIDE_F32_T filteredcurrentPressureReadings[ NUM_OF_PRESSURE_SENSORS ]; ///< filtered current pressure sensor pressure readings (overrideable). -static OVERRIDE_F32_T filteredcurrentPresTempReadings[ NUM_OF_PRESSURE_SENSORS ]; ///< filtered current pressure sensor temperature readings (overrideable). -//static DD_PRES_SENSORS_CAL_RECORD_T pressuresCalRecord; ///< Pressures calibration record. +static OVERRIDE_F32_T filteredcurrentPressureReadings[ NUM_OF_PRESSURE_SENSORS ]; ///< filtered current pressure sensor pressure readings (overrideable). +static OVERRIDE_F32_T filteredcurrentPresTempReadings[ NUM_OF_PRESSURE_SENSORS ]; ///< filtered current pressure sensor temperature readings (overrideable). +//static DD_PRES_SENSORS_CAL_RECORD_T pressuresCalRecord; ///< Pressures calibration record. -static FILTER_PRESSURE_READINGS_T filteredPressureReadings[NUM_OF_PRESSURE_SENSORS]; ///< Filtered pressure reading for pressure sensors. -static FILTER_PRESSURE_TEMPERATURE_READINGS_T filteredPressureTempReadings[NUM_OF_PRESSURE_SENSORS]; ///< Filtered pressure reading for pressure sensors. -static PRESSURE_STATE_T pressuresState; ///< current state of pressure monitor state machine. -static U32 ddPressuresDataPublicationTimerCounter; ///< used to schedule DD pressure data publication to CAN bus. -static U32 fpPressuresDataPublicationTimerCounter; ///< used to schedule FP pressure data publication to CAN bus. -static OVERRIDE_U32_T ddPressuresDataPublishInterval; ///< DD Pressure data publish interval. -static OVERRIDE_U32_T fpPressuresDataPublishInterval; ///< FP Pressure data publish interval. +static FILTER_PRESSURE_READINGS_T filteredPressureReadings[NUM_OF_PRESSURE_SENSORS]; ///< Filtered pressure reading for pressure sensors. +static FILTER_PRESSURE_TEMPERATURE_READINGS_T filteredPressureTempReadings[NUM_OF_PRESSURE_SENSORS]; ///< Filtered pressure reading for pressure sensors. +static PRESSURE_STATE_T pressuresState; ///< current state of pressure monitor state machine. +static U32 ddPressuresDataPublicationTimerCounter; ///< used to schedule DD pressure data publication to CAN bus. +static U32 fpPressuresDataPublicationTimerCounter; ///< used to schedule FP pressure data publication to CAN bus. +static OVERRIDE_U32_T ddPressuresDataPublishInterval; ///< DD Pressure data publish interval. +static OVERRIDE_U32_T fpPressuresDataPublishInterval; ///< FP Pressure data publish interval. // ********** private function prototypes ********** @@ -112,7 +110,7 @@ { U32 i; - pressuresState = PRESSURE_INIT_STATE; + pressuresState = PRESSURE_INIT_STATE; ddPressuresDataPublicationTimerCounter = DATA_PUBLISH_COUNTER_START_COUNT; fpPressuresDataPublicationTimerCounter = DATA_PUBLISH_COUNTER_START_COUNT; @@ -319,7 +317,6 @@ } } -// ToDo decide once BARO sensor location is finalized /*********************************************************************//** * @brief * The getConvertedPressure function converts the pressure in PSI unit and @@ -332,6 +329,7 @@ *************************************************************************/ static F32 getConvertedPressure( PRESSURE_SENSORS_T sensor, F32 pressure ) { + //TODO : Waiting for TD firmware implementation for Baro sensor // F32 baroPressurePSI = getPressure( BARO_PRES ) * MMHG_TO_PSI_CONVERSION; // calibrated pressure Index: firmware/App/Monitors/Temperature.c =================================================================== diff -u -rfd42b31a0572ab85c862ebf94997766f27dd8e97 -r97ea48347859157d941d743deedb5b980b4c4594 --- firmware/App/Monitors/Temperature.c (.../Temperature.c) (revision fd42b31a0572ab85c862ebf94997766f27dd8e97) +++ firmware/App/Monitors/Temperature.c (.../Temperature.c) (revision 97ea48347859157d941d743deedb5b980b4c4594) @@ -101,9 +101,7 @@ static U32 ddTempDataPublicationTimerCounter; ///< DD Temperature sensors data publish timer counter. static U32 fpTempDataPublicationTimerCounter; ///< FP Temperature sensors data publish timer counter. static OVERRIDE_U32_T ddTempSensorsPublishInterval; ///< DD Temperature sensors publish time interval override. -static OVERRIDE_U32_T fpTempSensorsPublishInterval; ///< FPppp Temperature sensors publish time interval override. -//static OVERRIDE_U32_T ddTempSensorsPublishInterval = { TEMP_SENSORS_DATA_PUBLISH_INTERVAL, -// TEMP_SENSORS_DATA_PUBLISH_INTERVAL, 0, 0 }; ///< Temperature sensors publish time interval override. +static OVERRIDE_U32_T fpTempSensorsPublishInterval; ///< FP Temperature sensors publish time interval override. // ********** private function prototypes ********** @@ -113,6 +111,7 @@ static void filterDialTemperatureReadings( void ); static void getTempMovingAverageTimeInterval( void ); static void publishTemperatureSensorsData( void ); + /*********************************************************************//** * @brief * The initTemperature function initializes the temperature unit. @@ -488,10 +487,10 @@ { TEMPERATURE_SENSORS_FP_DATA_T data; -// data.p10Temp = getFilteredConductivitySensorTemperature( P9_COND ); -// data.p19Temp = getFilteredConductivitySensorTemperature( P18_COND ); data.m1Temp = getFilteredPressureSensorTemperature( M1_PRES ); data.m3Temp = getFilteredPressureSensorTemperature( M3_PRES ); + data.p10Temp = getFilteredConductivitySensorTemperature( P9_COND ); + data.p19Temp = getFilteredConductivitySensorTemperature( P18_COND ); data.p8Temp = getFilteredPressureSensorTemperature( P8_PRES ); data.p13Temp = getFilteredPressureSensorTemperature( P13_PRES ); data.p17Temp = getFilteredPressureSensorTemperature( P17_PRES ); Index: firmware/App/Monitors/Temperature.h =================================================================== diff -u -r21e1b8bddecb1bf7bef4f371d4adc5c2fbcb336a -r97ea48347859157d941d743deedb5b980b4c4594 --- firmware/App/Monitors/Temperature.h (.../Temperature.h) (revision 21e1b8bddecb1bf7bef4f371d4adc5c2fbcb336a) +++ firmware/App/Monitors/Temperature.h (.../Temperature.h) (revision 97ea48347859157d941d743deedb5b980b4c4594) @@ -59,18 +59,17 @@ /// Temperature sensors data structure. typedef struct { - F32 p10Temp; ///< P10 temperature from inlet conductivity sensor. - F32 p19Temp; ///< P19 temperature from outlet conductivity sensor. F32 m1Temp; ///< Temperature before pressure regulator (M1) F32 m3Temp; ///< Temperature after pressure regulator (M3) + F32 p10Temp; ///< P10 temperature from inlet conductivity sensor. + F32 p19Temp; ///< P19 temperature from outlet conductivity sensor. F32 p8Temp; ///< Temperature before inlet conductivity sensor (P8) F32 p13Temp; ///< Temperature before RO filter (P13) F32 p17Temp; ///< Temperature after RO filter (P17) F32 p7Temp; ///< Temperature RO inlet F32 p16Temp; ///< Temperature RO outlet } TEMPERATURE_SENSORS_FP_DATA_T; - // ********** public function prototypes ********** void initTemperature( void );