Index: firmware/App/Drivers/PressureSensor.c =================================================================== diff -u -r311c75cc5ac41b4b9ca4983df84e43af910f9be4 -r94d93795b2a516b3bdd7fc7030eb5eac933bfcd0 --- firmware/App/Drivers/PressureSensor.c (.../PressureSensor.c) (revision 311c75cc5ac41b4b9ca4983df84e43af910f9be4) +++ firmware/App/Drivers/PressureSensor.c (.../PressureSensor.c) (revision 94d93795b2a516b3bdd7fc7030eb5eac933bfcd0) @@ -33,10 +33,9 @@ #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 -14.5038F ///< Minimum value for PSI conversion +#define HIGH_PRES_MAX_PSI 145.038F ///< Maximum range of pressure sensors (in PSI) -#define PRES_MIN_PSI 0.0F ///< Minimum range of pressure sensors (in PSI) -#define PRES_MAX_PSI 145.038F ///< Maximum range of pressure sensors (in PSI) - // ********** private data ********** static OVERRIDE_F32_T currentPressureReadings[ NUM_OF_PRESSURE_SENSORS ]; ///< Current pressure sensor pressure readings (overrideable). @@ -98,15 +97,15 @@ void readPressureSensors( void ) { // Update and convert raw pressures to mmHg - currentPressureReadings[ M1_PRES ].data = convertPressureReading( getFPGAM1RawPressure(), PRES_MIN_PSI, PRES_MAX_PSI ); - currentPressureReadings[ M3_PRES ].data = convertPressureReading( getFPGAM3RawPressure(), PRES_MIN_PSI, PRES_MAX_PSI ); - currentPressureReadings[ P8_PRES ].data = convertPressureReading( getFPGAP8RawPressure(), PRES_MIN_PSI, PRES_MAX_PSI ); - currentPressureReadings[ P13_PRES ].data = convertPressureReading( getFPGAP13RawPressure(), PRES_MIN_PSI, PRES_MAX_PSI ); - currentPressureReadings[ P17_PRES ].data = convertPressureReading( getFPGAP17RawPressure(), PRES_MIN_PSI, PRES_MAX_PSI ); - currentPressureReadings[ X1_PRES ].data = convertPressureReading( getFPGAX1RawPressure(), PRES_MIN_PSI, PRES_MAX_PSI ); - currentPressureReadings[ X2_PRES ].data = convertPressureReading( getFPGAX2RawPressure(), PRES_MIN_PSI, PRES_MAX_PSI ); - currentPressureReadings[ X3_PRES ].data = convertPressureReading( getFPGAX3RawPressure(), PRES_MIN_PSI, PRES_MAX_PSI ); - currentPressureReadings[ X4_PRES ].data = convertPressureReading( getFPGAX4RawPressure(), PRES_MIN_PSI, PRES_MAX_PSI ); + 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 ); // Update and convert raw pressure sensor temperatures to deg C currentPresTempReadings[ M1_PRES ].data = convertPressureTempReading2DegC( getFPGAM1RawTemperature() );