Index: firmware/App/Drivers/PressureSensor.c =================================================================== diff -u -raeffb83507735fc1c84773e868e20ac7aeb60afc -rfd42b31a0572ab85c862ebf94997766f27dd8e97 --- firmware/App/Drivers/PressureSensor.c (.../PressureSensor.c) (revision aeffb83507735fc1c84773e868e20ac7aeb60afc) +++ firmware/App/Drivers/PressureSensor.c (.../PressureSensor.c) (revision fd42b31a0572ab85c862ebf94997766f27dd8e97) @@ -54,13 +54,6 @@ static OVERRIDE_F32_T currentPresTempReadings[ NUM_OF_PRESSURE_SENSORS ]; ///< Current pressure sensor temperature readings (overrideable). //static BARO_SENSOR_CONSTS_T baroConvConsts; ///< Barometric sensor conversion constants. -//static const U32 TWO_TO_POWER_OF_6 = ( 1 << 6 ); ///< 2^6. -//static const U32 TWO_TO_POWER_OF_7 = ( 1 << 7 ); ///< 2^7. -//static const U32 TWO_TO_POWER_OF_15 = ( 1 << 15 ); ///< 2^15. -//static const U32 TWO_TO_POWER_OF_16 = ( 1 << 16 ); ///< 2^16. -//static const U32 TWO_TO_POWER_OF_17 = ( 1 << 17 ); ///< 2^17. -//static const U32 TWO_TO_POWER_OF_21 = ( 1 << 21 ); ///< 2^21. - // ********** private function prototypes ********** //static F32 convertBaroPressureReading2mmHg( U32 rawPressure ); @@ -116,16 +109,7 @@ F32 presMinPSI = PRES_MIN_PSI; // Update and convert raw pressures to mmHg - if ( getTestConfigStatus( TEST_CONFIG_BETA_HW ) != TRUE ) - { - presMinPSI = PRES_MIN_PSI_ALPHA; - currentPressureReadings[ D9_PRES ].data = convertPressureReading( getFPGAD9PresRawPressure(), presMinPSI, HIGH_PRES_MAX_PSI ); - } - else - { - currentPressureReadings[ D9_PRES ].data = convertPressureReading( getFPGAD9PresRawPressure(), 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 ); @@ -269,7 +253,7 @@ * @details \b Inputs: none * @details \b Outputs: currentPressureReadings[] * @param message Override message from Dialin which includes an sensor - * ID and override value of the pressure sensor. + * ID and override value of the DD pressure sensor. * @return TRUE if override successful, FALSE if not *************************************************************************/ BOOL testDDPressureSensorReadingsOverride( MESSAGE_T *message ) @@ -286,7 +270,7 @@ * @details \b Inputs: none * @details \b Outputs: currentPresTempReadings[] * @param message Override message from Dialin which includes an sensor - * ID and override value of the pressure sensor temperature. + * ID and override value of the DD pressure sensor temperature. * @return TRUE if override successful, FALSE if not *************************************************************************/ BOOL testDDPressureSensorTemperatureReadingsOverride( MESSAGE_T *message ) @@ -298,35 +282,49 @@ /*********************************************************************//** * @brief - * The testFPPressureSensorReadingsOverride function overrides the value of - * the specified FP pressure sensor with a given value. + * The testIOFPPressureSensorReadingsOverride function overrides the value of + * the specified IOFP pressure sensor with a given value. * @details \b Inputs: none * @details \b Outputs: currentPressureReadings[] * @param message Override message from Dialin which includes an sensor - * ID and override value of the pressure sensor. + * ID and override value of the IOFP pressure sensor. * @return TRUE if override successful, FALSE if not *************************************************************************/ -BOOL testFPPressureSensorReadingsOverride( MESSAGE_T *message ) +BOOL testIOFPPressureSensorReadingsOverride( MESSAGE_T *message ) { - BOOL result = f32ArrayOverride( message, ¤tPressureReadings[FIRST_IO_PRESSURE_SENSOR], NUM_OF_PRESSURE_SENSORS - 1 ); + BOOL result = FALSE; + TEST_OVERRIDE_ARRAY_PAYLOAD_T payload; + OVERRIDE_TYPE_T ovType = getOverrideArrayPayloadFromMessage( message, &payload ); + if ( ( payload.index >= FIRST_IO_PRESSURE_SENSOR ) && ( payload.index <= LAST_FP_PRESSURE_SENSOR ) ) + { + BOOL result = f32ArrayOverride( message, ¤tPressureReadings[0], NUM_OF_PRESSURE_SENSORS - 1 ); + } + return result; } /*********************************************************************//** * @brief - * The testFPPressureSensorTemperatureReadingsOverride function overrides the - * value of the specified FP pressure sensor temperature with a given value. + * The testIOFPPressureSensorTemperatureReadingsOverride function overrides the + * value of the specified IOFP pressure sensor temperature with a given value. * @details \b Inputs: none * @details \b Outputs: currentPresTempReadings[] * @param message Override message from Dialin which includes an sensor - * ID and override value of the pressure sensor temperature. + * ID and override value of the IOFP pressure sensor temperature. * @return TRUE if override successful, FALSE if not *************************************************************************/ -BOOL testFPPressureSensorTemperatureReadingsOverride( MESSAGE_T *message ) +BOOL testIOFPPressureSensorTemperatureReadingsOverride( MESSAGE_T *message ) { - BOOL result = f32ArrayOverride( message, ¤tPresTempReadings[FIRST_IO_PRESSURE_SENSOR], NUM_OF_PRESSURE_SENSORS - 1 ); + BOOL result = FALSE; + TEST_OVERRIDE_ARRAY_PAYLOAD_T payload; + OVERRIDE_TYPE_T ovType = getOverrideArrayPayloadFromMessage( message, &payload ); + if ( ( payload.index >= FIRST_IO_PRESSURE_SENSOR ) && ( payload.index <= LAST_FP_PRESSURE_SENSOR ) ) + { + BOOL result = f32ArrayOverride( message, ¤tPresTempReadings[0], NUM_OF_PRESSURE_SENSORS - 1 ); + } + return result; }