Index: firmware/App/Drivers/PressureSensor.c =================================================================== diff -u -r364181b1c7ef0ae4d88a7bb0001a34e93fdb495f -re6504e7e162d00745033a55191d6f810d2753105 --- firmware/App/Drivers/PressureSensor.c (.../PressureSensor.c) (revision 364181b1c7ef0ae4d88a7bb0001a34e93fdb495f) +++ firmware/App/Drivers/PressureSensor.c (.../PressureSensor.c) (revision e6504e7e162d00745033a55191d6f810d2753105) @@ -39,25 +39,13 @@ #define BAR_TO_MMHG ( 750.062F ) ///< Conversion factor for converting bar to mmHg. #define PRES_SENSORS_READ_ERR_MAX_CNT 255 ///< Pressure sensor read and error max count value -/// Barometric sensor conversion coefficients -typedef struct -{ - U16 pressureSensitivity; ///< Barometric sensor pressure sensitivity constant. - U16 pressureOffset; ///< Barometric sensor pressure offset constant. - U16 pressureSensitivityTempCoeff; ///< Barometric sensor pressure sensitivity temperature coefficient. - U16 pressureOffsetTempCoeff; ///< Barometric sensor pressure offset temperature coefficient. -} BARO_SENSOR_CONSTS_T; - // ********** private data ********** static OVERRIDE_F32_T currentPressureReadings[ NUM_OF_PRESSURE_SENSORS ]; ///< Current pressure sensor pressure readings (overrideable). static OVERRIDE_F32_T currentPresTempReadings[ NUM_OF_PRESSURE_SENSORS ]; ///< Current pressure sensor temperature readings (overrideable). -//static BARO_SENSOR_CONSTS_T baroConvConsts; ///< Barometric sensor conversion constants. // ********** private function prototypes ********** -//static F32 convertBaroPressureReading2mmHg( U32 rawPressure ); -//static F32 calculateBaroPressure( U32 pressure ); /*********************************************************************//** * @brief @@ -84,11 +72,6 @@ currentPresTempReadings[ sensor ].override = OVERRIDE_RESET; } - //Initialize baro variable -// baroConvConsts.pressureOffset = 0; -// baroConvConsts.pressureOffsetTempCoeff = 0; -// baroConvConsts.pressureSensitivity = 0; -// baroConvConsts.pressureSensitivityTempCoeff = 0; } /*********************************************************************//** @@ -114,7 +97,6 @@ currentPressureReadings[ D51_PRES ].data = convertPressureReading( getFPGAD51PresRawPressure(), presMinPSI, LOW_PRES_MAX_PSI ); currentPressureReadings[ D18_PRES ].data = convertPressureReading( getFPGAD18PresRawPressure(), presMinPSI, LOW_PRES_MAX_PSI ); currentPressureReadings[ D41_PRES ].data = convertPressureReading( getFPGAD41PresRawPressure(), presMinPSI, LOW_PRES_MAX_PSI ); -// currentPressureReadings[ BARO_PRES ].data = convertBaroPressureReading2mmHg( getFPGABaroPressure() ); currentPressureReadings[ M1_PRES ].data = convertPressureReading( getFPGAM1RawPressure(), presMinPSI, HIGH_PRES_MAX_PSI ); currentPressureReadings[ M3_PRES ].data = convertPressureReading( getFPGAM3RawPressure(), presMinPSI, HIGH_PRES_MAX_PSI ); currentPressureReadings[ P8_PRES ].data = convertPressureReading( getFPGAP8RawPressure(), presMinPSI, HIGH_PRES_MAX_PSI ); @@ -134,52 +116,6 @@ currentPresTempReadings[ P17_PRES ].data = convertPressureTempReading2DegC( getFPGAP17RawTemperature() ); } -///*********************************************************************//** -// * @brief -// * The convertBaroPressureReading2mmHg function converts the raw pressure counts -// * in to mmHg unit. -// * @details \b Inputs: FPGA -// * @details \b Outputs: baroConvConsts -// * @param rawPressure the raw baro sensor reading from FPGA. -// * @return the converted baro pressure (in mmHg). -// *************************************************************************/ -//static F32 convertBaroPressureReading2mmHg( U32 rawPressure ) -//{ -// F32 baroPressure = 0.0F; -// -// baroConvConsts.pressureSensitivity = getFPGABaroPressureSensitivity(); -// baroConvConsts.pressureSensitivityTempCoeff = getFPGABaroTempCoeffOfPressSensitvity(); -// baroConvConsts.pressureOffset = getFPGABaroPressureOffset(); -// baroConvConsts.pressureOffsetTempCoeff = getFPGABaroTempCoeffOfPressOffset(); -// baroPressure = calculateBaroPressure( rawPressure ); -// -// return baroPressure; -//} - -///*********************************************************************//** -// * @brief -// * The calculateBaroPressure function performs the required calculations -// * to compute the baro pressure readings. -// * @details \b Inputs: baroConvConsts -// * @details \b Outputs: none -// * @param pressure the raw baro sensor reading from FPGA. -// * @return converted baro pressure (in mmHg). -// *************************************************************************/ -//static F32 calculateBaroPressure( U32 pressure ) -//{ -// S32 tempDiff = getBaroSensorTemperatureDiff(); -// S64 tempOffset = ( baroConvConsts.pressureOffsetTempCoeff * tempDiff ) / TWO_TO_POWER_OF_6; -// S64 presOffset = baroConvConsts.pressureOffset * TWO_TO_POWER_OF_17; -// S64 offset = presOffset + tempOffset; -// S64 tempSensitivity = ( baroConvConsts.pressureSensitivityTempCoeff * tempDiff ) / TWO_TO_POWER_OF_7; -// S64 presSensitivity = baroConvConsts.pressureSensitivity * TWO_TO_POWER_OF_16; -// S64 sensitivity = tempSensitivity + presSensitivity; -// S32 pres = (S32)( ( ( pressure * sensitivity ) / TWO_TO_POWER_OF_21 ) - offset ) / TWO_TO_POWER_OF_15; -// F32 presmmHg = ( (F32)pres / (F32)( COUNTS_TO_MILLI_BAR * ONE_BAR_TO_MILLI_BAR ) ) * BAR_TO_MMHG; -// -// return presmmHg; -//} - /*********************************************************************//** * @brief * The getPressure function gets the current pressure (in mmHg) for a given