Index: firmware/App/Drivers/PressureSensor.c =================================================================== diff -u -r051cd0430ef8342bd606115c98871e26dc24acf1 -r3a5cc585b69ffa194e3601a005915d23b48bd865 --- firmware/App/Drivers/PressureSensor.c (.../PressureSensor.c) (revision 051cd0430ef8342bd606115c98871e26dc24acf1) +++ firmware/App/Drivers/PressureSensor.c (.../PressureSensor.c) (revision 3a5cc585b69ffa194e3601a005915d23b48bd865) @@ -15,8 +15,8 @@ * ***************************************************************************/ -#include "AlarmMgmtRO.h" -#include "FpgaRO.h" +#include "AlarmMgmtFP.h" +#include "FpgaFP.h" #include "Messaging.h" #include "PersistentAlarm.h" #include "PressureSensor.h" @@ -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,28 +97,26 @@ 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[ X5_PRES ].data = convertPressureReading( getFPGAX5RawPressure(), 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() ); - currentPresTempReadings[ M3_PRES ].data = convertPressureTempReading2DegC( getFPGAM3RawTemperature() ); + currentPresTempReadings[ M3_PRES ].data = convertPressureTempReading2DegC( getFPGAM3RawTemperature() ); currentPresTempReadings[ P8_PRES ].data = convertPressureTempReading2DegC( getFPGAP8RawTemperature() ); currentPresTempReadings[ P13_PRES ].data = convertPressureTempReading2DegC( getFPGAP13RawTemperature() ); currentPresTempReadings[ P17_PRES ].data = convertPressureTempReading2DegC( getFPGAP17RawTemperature() ); currentPresTempReadings[ X1_PRES ].data = convertPressureTempReading2DegC( getFPGAX1RawTemperature() ); currentPresTempReadings[ X2_PRES ].data = convertPressureTempReading2DegC( getFPGAX2RawTemperature() ); currentPresTempReadings[ X3_PRES ].data = convertPressureTempReading2DegC( getFPGAX3RawTemperature() ); currentPresTempReadings[ X4_PRES ].data = convertPressureTempReading2DegC( getFPGAX4RawTemperature() ); - currentPresTempReadings[ X5_PRES ].data = convertPressureTempReading2DegC( getFPGAX5RawTemperature() ); // Update read and error counters for each pressure sensor lastPressureReadCounter[ M1_PRES ].data = (U32)getFPGAM1ReadCount(); @@ -131,7 +128,6 @@ lastPressureReadCounter[ X2_PRES ].data = (U32)getFPGAX2ReadCount(); lastPressureReadCounter[ X3_PRES ].data = (U32)getFPGAX3ReadCount(); lastPressureReadCounter[ X4_PRES ].data = (U32)getFPGAX4ReadCount(); - lastPressureReadCounter[ X5_PRES ].data = (U32)getFPGAX5ReadCount(); // // Monitor pressure sensor health // checkPressureSensors();