Index: firmware/App/Drivers/PressureSensor.c =================================================================== diff -u -r3edf8084a5028ee0d00a3fba496284e593e4254d -r51d83f99e63d9cb52951097996641cc5b3ddffd7 --- firmware/App/Drivers/PressureSensor.c (.../PressureSensor.c) (revision 3edf8084a5028ee0d00a3fba496284e593e4254d) +++ firmware/App/Drivers/PressureSensor.c (.../PressureSensor.c) (revision 51d83f99e63d9cb52951097996641cc5b3ddffd7) @@ -34,6 +34,9 @@ #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 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). @@ -100,11 +103,11 @@ void readPressureSensors( void ) { // Update and convert raw pressures to mmHg - currentPressureReadings[ PRESSURE_SENSOR_WATER_INLET_PRE_REG ].data = convertPressureReading2mmHg( getFPGAPRiRawPressure() ); - currentPressureReadings[ PRESSURE_SENSOR_WATER_INLET_POST_REG ].data = convertPressureReading2mmHg( getFPGAPRoRawPressure() ); - currentPressureReadings[ PRESSURE_SENSOR_WATER_INLET_PRE_COND ].data = convertPressureReading2mmHg( getFPGAPC2oRawPressure() ); - currentPressureReadings[ PRESSURE_SENSOR_PRE_RO_FILTER ].data = convertPressureReading2mmHg( getFPGAPPoRawPressure() ); - currentPressureReadings[ PRESSURE_SENSOR_POST_RO_FILTER ].data = convertPressureReading2mmHg( getFPGAPMpRawPressure() ); + currentPressureReadings[ PRESSURE_SENSOR_WATER_INLET_PRE_REG ].data = convertPressureReading( getFPGAPRiRawPressure(), PRES_MIN_PSI, PRES_MAX_PSI ); + currentPressureReadings[ PRESSURE_SENSOR_WATER_INLET_POST_REG ].data = convertPressureReading( getFPGAPRoRawPressure(), PRES_MIN_PSI, PRES_MAX_PSI ); + currentPressureReadings[ PRESSURE_SENSOR_WATER_INLET_PRE_COND ].data = convertPressureReading( getFPGAPC2oRawPressure(), PRES_MIN_PSI, PRES_MAX_PSI ); + currentPressureReadings[ PRESSURE_SENSOR_PRE_RO_FILTER ].data = convertPressureReading( getFPGAPPoRawPressure(), PRES_MIN_PSI, PRES_MAX_PSI ); + currentPressureReadings[ PRESSURE_SENSOR_POST_RO_FILTER ].data = convertPressureReading( getFPGAPMpRawPressure(), PRES_MIN_PSI, PRES_MAX_PSI ); // Update and convert raw pressure sensor temperatures to deg C currentPresTempReadings[ PRESSURE_SENSOR_WATER_INLET_PRE_REG ].data = convertPressureTempReading2DegC( getFPGAPRiRawTemperature() );