Index: firmware/App/Drivers/PressureSensor.c =================================================================== diff -u -r3a5cc585b69ffa194e3601a005915d23b48bd865 -rce8184d7aa4219126d61835c237c6fd28f284396 --- firmware/App/Drivers/PressureSensor.c (.../PressureSensor.c) (revision 3a5cc585b69ffa194e3601a005915d23b48bd865) +++ firmware/App/Drivers/PressureSensor.c (.../PressureSensor.c) (revision ce8184d7aa4219126d61835c237c6fd28f284396) @@ -33,6 +33,7 @@ #define COUNTS_TO_MILLI_BAR 100 ///< Counts to milli-bar conversion. #define BAR_TO_MMHG ( 750.062F ) ///< Conversion factor for converting bar to mmHg. #define PRES_SENSORS_READ_ERR_MAX_CNT 0xFF ///< Pressure sensor read and error max count value +#define PRES_MIN_PSI_ALPHA 0.0F ///< Minimum value for PSI conversion #define PRES_MIN_PSI -14.5038F ///< Minimum value for PSI conversion #define HIGH_PRES_MAX_PSI 145.038F ///< Maximum range of pressure sensors (in PSI) @@ -97,15 +98,15 @@ void readPressureSensors( void ) { // Update and convert raw pressures to mmHg - currentPressureReadings[ M1_PRES ].data = convertPressureReading( getFPGAM1RawPressure(), PRES_MIN_PSI, HIGH_PRES_MAX_PSI ); - currentPressureReadings[ M3_PRES ].data = convertPressureReading( getFPGAM3RawPressure(), PRES_MIN_PSI, HIGH_PRES_MAX_PSI ); - currentPressureReadings[ P8_PRES ].data = convertPressureReading( getFPGAP8RawPressure(), PRES_MIN_PSI, HIGH_PRES_MAX_PSI ); - currentPressureReadings[ P13_PRES ].data = convertPressureReading( getFPGAP13RawPressure(), PRES_MIN_PSI, HIGH_PRES_MAX_PSI ); - currentPressureReadings[ P17_PRES ].data = convertPressureReading( getFPGAP17RawPressure(), PRES_MIN_PSI, HIGH_PRES_MAX_PSI ); - currentPressureReadings[ X1_PRES ].data = convertPressureReading( getFPGAX1RawPressure(), PRES_MIN_PSI, HIGH_PRES_MAX_PSI ); - currentPressureReadings[ X2_PRES ].data = convertPressureReading( getFPGAX2RawPressure(), PRES_MIN_PSI, HIGH_PRES_MAX_PSI ); - currentPressureReadings[ X3_PRES ].data = convertPressureReading( getFPGAX3RawPressure(), PRES_MIN_PSI, HIGH_PRES_MAX_PSI ); - currentPressureReadings[ X4_PRES ].data = convertPressureReading( getFPGAX4RawPressure(), PRES_MIN_PSI, HIGH_PRES_MAX_PSI ); + currentPressureReadings[ M1_PRES ].data = convertPressureReading( getFPGAM1RawPressure(), PRES_MIN_PSI_ALPHA, HIGH_PRES_MAX_PSI ); + currentPressureReadings[ M3_PRES ].data = convertPressureReading( getFPGAM3RawPressure(), PRES_MIN_PSI_ALPHA, HIGH_PRES_MAX_PSI ); + currentPressureReadings[ P8_PRES ].data = convertPressureReading( getFPGAP8RawPressure(), PRES_MIN_PSI_ALPHA, HIGH_PRES_MAX_PSI ); + currentPressureReadings[ P13_PRES ].data = convertPressureReading( getFPGAP13RawPressure(), PRES_MIN_PSI_ALPHA, HIGH_PRES_MAX_PSI ); + currentPressureReadings[ P17_PRES ].data = convertPressureReading( getFPGAP17RawPressure(), PRES_MIN_PSI_ALPHA, HIGH_PRES_MAX_PSI ); + currentPressureReadings[ X1_PRES ].data = convertPressureReading( getFPGAX1RawPressure(), PRES_MIN_PSI_ALPHA, HIGH_PRES_MAX_PSI ); + currentPressureReadings[ X2_PRES ].data = convertPressureReading( getFPGAX2RawPressure(), PRES_MIN_PSI_ALPHA, HIGH_PRES_MAX_PSI ); + currentPressureReadings[ X3_PRES ].data = convertPressureReading( getFPGAX3RawPressure(), PRES_MIN_PSI_ALPHA, HIGH_PRES_MAX_PSI ); + currentPressureReadings[ X4_PRES ].data = convertPressureReading( getFPGAX4RawPressure(), PRES_MIN_PSI_ALPHA, HIGH_PRES_MAX_PSI ); // Update and convert raw pressure sensor temperatures to deg C currentPresTempReadings[ M1_PRES ].data = convertPressureTempReading2DegC( getFPGAM1RawTemperature() );