Index: firmware/App/Drivers/PressureSensor.c =================================================================== diff -u -rafb05eebd86337012af4f6a9d21cb9a1e7f5f16a -reaa0ce5fe4890d9c7ff14d14828ea90209c1ad97 --- firmware/App/Drivers/PressureSensor.c (.../PressureSensor.c) (revision afb05eebd86337012af4f6a9d21cb9a1e7f5f16a) +++ firmware/App/Drivers/PressureSensor.c (.../PressureSensor.c) (revision eaa0ce5fe4890d9c7ff14d14828ea90209c1ad97) @@ -32,11 +32,8 @@ #define PRES_SENSORS_COUNT_ERROR_TIMEOUT_MS ( 2 * MS_PER_SECOND ) ///< Pressure sensors read and error count timeout in milliseconds. #define HIGH_PRES_MAX_PSI 145.038F ///< Convert pressure to PSI for 10 bar pressure sensor #define LOW_PRES_MAX_PSI 50.7632F ///< Convert pressure to PSI for 3.5 bar pressure sensor -#ifndef __BETA_HW_VER__ -#define PRES_MIN_PSI 0.0F ///< Minimum value for PSI conversion -#else +#define PRES_MIN_PSI_ALPHA 0.0F ///< Minimum value for PSI conversion for alpha systems #define PRES_MIN_PSI -14.5038F ///< Minimum value for PSI conversion -#endif #define ONE_BAR_TO_MILLI_BAR 1000 ///< 1 bar to milli-bar conversion. #define COUNTS_TO_MILLI_BAR 100 ///< Counts to milli-bar conversion. #define BAR_TO_MMHG ( 750.062F ) ///< Conversion factor for converting bar to mmHg. @@ -145,25 +142,32 @@ *************************************************************************/ void readPressureSensors( void ) { + F32 presMinPSI = PRES_MIN_PSI; + // Update and convert raw pressures to mmHg -#ifndef __BETA_HW_VER__ - currentPressureReadings[ M1_PRES ].data = convertPressureReading( getFPGAM1PresRawPressure(), PRES_MIN_PSI, HIGH_PRES_MAX_PSI ); - currentPressureReadings[ M3_PRES ].data = convertPressureReading( getFPGAM3PresRawPressure(),PRES_MIN_PSI, HIGH_PRES_MAX_PSI ); - currentPressureReadings[ D9_PRES ].data = convertPressureReading( getFPGAD9PresRawPressure(),PRES_MIN_PSI, HIGH_PRES_MAX_PSI ); -#else - currentPressureReadings[ M1_PRES ].data = convertPressureReading( getFPGAM1PresRawPressure(), PRES_MIN_PSI, LOW_PRES_MAX_PSI ); - currentPressureReadings[ M3_PRES ].data = convertPressureReading( getFPGAM3PresRawPressure(),PRES_MIN_PSI, LOW_PRES_MAX_PSI ); - currentPressureReadings[ D9_PRES ].data = convertPressureReading( getFPGAD9PresRawPressure(),PRES_MIN_PSI, LOW_PRES_MAX_PSI ); -#endif - currentPressureReadings[ D66_PRES ].data = convertPressureReading( getFPGAD66PresRawPressure(), PRES_MIN_PSI, LOW_PRES_MAX_PSI ); - currentPressureReadings[ D51_PRES ].data = convertPressureReading( getFPGAD51PresRawPressure(), PRES_MIN_PSI, LOW_PRES_MAX_PSI ); - currentPressureReadings[ D18_PRES ].data = convertPressureReading( getFPGAD18PresRawPressure(), PRES_MIN_PSI, LOW_PRES_MAX_PSI ); - currentPressureReadings[ D41_PRES ].data = convertPressureReading( getFPGAD41PresRawPressure(), PRES_MIN_PSI, LOW_PRES_MAX_PSI ); + if ( getTestConfigStatus( TEST_CONFIG_BETA_HW ) != TRUE ) + { + presMinPSI = PRES_MIN_PSI_ALPHA; + currentPressureReadings[ M1_PRES ].data = convertPressureReading( getFPGAM1PresRawPressure(), presMinPSI, HIGH_PRES_MAX_PSI ); + currentPressureReadings[ M3_PRES ].data = convertPressureReading( getFPGAM3PresRawPressure(), presMinPSI, HIGH_PRES_MAX_PSI ); + currentPressureReadings[ D9_PRES ].data = convertPressureReading( getFPGAD9PresRawPressure(), presMinPSI, HIGH_PRES_MAX_PSI ); + } + else + { + currentPressureReadings[ M1_PRES ].data = convertPressureReading( getFPGAM1PresRawPressure(), presMinPSI, LOW_PRES_MAX_PSI ); + currentPressureReadings[ M3_PRES ].data = convertPressureReading( getFPGAM3PresRawPressure(), presMinPSI, LOW_PRES_MAX_PSI ); + currentPressureReadings[ D9_PRES ].data = convertPressureReading( getFPGAD9PresRawPressure(), presMinPSI, LOW_PRES_MAX_PSI ); + } + + currentPressureReadings[ D66_PRES ].data = convertPressureReading( getFPGAD66PresRawPressure(), presMinPSI, LOW_PRES_MAX_PSI ); + 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() ); // Update and convert raw pressure sensor temperatures to deg C currentPresTempReadings[ M1_PRES ].data = convertPressureTempReading2DegC( getFPGAM1PresRawTemperature() ); - currentPresTempReadings[ M3_PRES ].data = convertPressureTempReading2DegC( getFPGAM3PresRawTemperature() ); + currentPresTempReadings[ M3_PRES ].data = convertPressureTempReading2DegC( getFPGAM3PresRawTemperature() ); currentPresTempReadings[ D9_PRES ].data = convertPressureTempReading2DegC( getFPGAD9PresRawTemperature() ); currentPresTempReadings[ D66_PRES ].data = convertPressureTempReading2DegC( getFPGAD66PresRawTemperature() ); currentPresTempReadings[ D51_PRES ].data = convertPressureTempReading2DegC( getFPGAD51PresRawTemperature() );