Index: firmware/App/Drivers/PressureSensor.c =================================================================== diff -u -r2205857f59dd884c4af450239381387cfb560c2e -rd8cd7de2f84b26aafc153e2bb665a5058a040bf0 --- firmware/App/Drivers/PressureSensor.c (.../PressureSensor.c) (revision 2205857f59dd884c4af450239381387cfb560c2e) +++ firmware/App/Drivers/PressureSensor.c (.../PressureSensor.c) (revision d8cd7de2f84b26aafc153e2bb665a5058a040bf0) @@ -8,10 +8,10 @@ * @file PressureSensor.c * * @author (last) Sean Nash -* @date (last) 09-Nov-2024 +* @date (last) 18-Nov-2024 * * @author (original) Sean Nash -* @date (original) 09-Nov-2024 +* @date (original) 18-Nov-2024 * ***************************************************************************/ @@ -33,37 +33,18 @@ #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. -#define PRES_SENSORS_READ_ERR_MAX_CNT 255 ///< Pressure sensor read and error max count value +#define PRES_SENSORS_READ_ERR_MAX_CNT 0xFF ///< Pressure sensor read and error max count value -/// Barometric sensor conversion coefficients -typedef struct -{ - U16 pressureSensitivity; ///< Barometric sensor pressure sensitivity constant. - U16 pressureOffset; ///< Barometric sensor pressure offset constant. - U16 pressureSensitivityTempCoeff; ///< Barometric sensor pressure sensitivity temperature coefficient. - U16 pressureOffsetTempCoeff; ///< Barometric sensor pressure offset temperature coefficient. -} BARO_SENSOR_CONSTS_T; - -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 data ********** static OVERRIDE_F32_T currentPressureReadings[ NUM_OF_PRESSURE_SENSORS ]; ///< Current pressure sensor pressure readings (overrideable). static OVERRIDE_F32_T currentPresTempReadings[ NUM_OF_PRESSURE_SENSORS ]; ///< Current pressure sensor temperature readings (overrideable). static OVERRIDE_U32_T lastPressureReadCounter[ NUM_OF_PRESSURE_SENSORS ]; ///< Last pressure sensor read count (Overrideable). static OVERRIDE_U32_T lastPressureErrorCounter[ NUM_OF_PRESSURE_SENSORS ]; ///< Last pressure sensor error count (Overrideable). -static BARO_SENSOR_CONSTS_T baroConvConsts; ///< Barometric sensor conversion constants. // ********** private function prototypes ********** //static void checkPressureSensors( void ); -//static F32 convertBaroPressureReading2mmHg( U32 rawPressure ); -//static F32 calculateBaroPressure( U32 pressure ); /*********************************************************************//** * @brief @@ -100,12 +81,6 @@ lastPressureErrorCounter[ i ].override = OVERRIDE_RESET; } - //Initialize baro variable - baroConvConsts.pressureOffset = 0; - baroConvConsts.pressureOffsetTempCoeff = 0; - baroConvConsts.pressureSensitivity = 0; - baroConvConsts.pressureSensitivityTempCoeff = 0; - // Initialize the FPGA persistent alarms // initFPGAPersistentAlarm( FPGA_PERS_ERROR_HYDRAULICS_OUTLET_PRESSURE, ALARM_ID_DD_HYD_OUTLET_PRES_TIMEOUT_FAULT, // PRES_SENSORS_COUNT_ERROR_TIMEOUT_MS, PRES_SENSORS_COUNT_ERROR_TIMEOUT_MS ); @@ -138,94 +113,39 @@ *************************************************************************/ void readPressureSensors( void ) { -// // Update and convert raw pressures to mmHg -// currentPressureReadings[ PRESSURE_SENSOR_WATER_INLET_INPUT ].data = convertPressureReading2mmHg( getFPGAPRiRawPressure() ); -// currentPressureReadings[ PRESSURE_SENSOR_WATER_INLET_OUTPUT ].data = convertPressureReading2mmHg( getFPGAPRoRawPressure() ); -// currentPressureReadings[ PRESSURE_SENSOR_HYDRAULICS_OUTLET ].data = convertPressureReading2mmHg( getFPGAPnRawPressure() ); -// currentPressureReadings[ PRESSURE_SENSOR_BIBAG ].data = convertPressureReading2mmHg( getFPGAPCbRawPressure() ); -// currentPressureReadings[ PRESSURE_SENSOR_SPENT_DIALYSATE ].data = convertPressureReading2mmHg( getFPGAPDsRawPressure() ); -// currentPressureReadings[ PRESSURE_SENSOR_FRESH_DIALYSATE ].data = convertPressureReading2mmHg( getFPGAPDfRawPressure() ); -// currentPressureReadings[ PRESSURE_SENSOR_TRANSMEMBRANE ].data = convertPressureReading2mmHg( getFPGAPtmRawPressure() ); -// currentPressureReadings[ PRESSURE_SENSOR_BAROMETRIC ].data = convertBaroPressureReading2mmHg( getFPGABaroPressure() ); -// -// // Update and convert raw pressure sensor temperatures to deg C -// currentPresTempReadings[ PRESSURE_SENSOR_WATER_INLET_INPUT ].data = convertPressureTempReading2DegC( getFPGAPRiRawTemperature() ); -// currentPresTempReadings[ PRESSURE_SENSOR_WATER_INLET_OUTPUT ].data = convertPressureTempReading2DegC( getFPGAPRoRawTemperature() ); -// currentPresTempReadings[ PRESSURE_SENSOR_HYDRAULICS_OUTLET ].data = convertPressureTempReading2DegC( getFPGAPnRawTemperature() ); -// currentPresTempReadings[ PRESSURE_SENSOR_BIBAG ].data = convertPressureTempReading2DegC( getFPGAPCbRawTemperature() ); -// currentPresTempReadings[ PRESSURE_SENSOR_SPENT_DIALYSATE ].data = convertPressureTempReading2DegC( getFPGAPDsRawTemperature() ); -// currentPresTempReadings[ PRESSURE_SENSOR_FRESH_DIALYSATE ].data = convertPressureTempReading2DegC( getFPGAPDfRawTemperature() ); -// currentPresTempReadings[ PRESSURE_SENSOR_TRANSMEMBRANE ].data = convertPressureTempReading2DegC( getFPGAPtmRawTemperature() ); -// -// // Update read and error counters for each pressure sensor -// lastPressureReadCounter[ PRESSURE_SENSOR_WATER_INLET_INPUT ].data = (U32)getFPGAPRiReadCount(); -// lastPressureReadCounter[ PRESSURE_SENSOR_WATER_INLET_OUTPUT ].data = (U32)getFPGAPRoReadCount(); -// lastPressureReadCounter[ PRESSURE_SENSOR_HYDRAULICS_OUTLET ].data = (U32)getFPGAPnReadCount(); -// lastPressureReadCounter[ PRESSURE_SENSOR_BIBAG ].data = (U32)getFPGAPCbReadCount(); -// lastPressureReadCounter[ PRESSURE_SENSOR_SPENT_DIALYSATE ].data = (U32)getFPGAPDsReadCount(); -// lastPressureReadCounter[ PRESSURE_SENSOR_FRESH_DIALYSATE ].data = (U32)getFPGAPDfReadCount(); -// lastPressureReadCounter[ PRESSURE_SENSOR_TRANSMEMBRANE ].data = (U32)getFPGAPtmReadCount(); -// -// lastPressureErrorCounter[ PRESSURE_SENSOR_WATER_INLET_INPUT ].data = (U32)getFPGAPRiErrorCount(); -// lastPressureErrorCounter[ PRESSURE_SENSOR_WATER_INLET_OUTPUT ].data = (U32)getFPGAPRoErrorCount(); -// lastPressureErrorCounter[ PRESSURE_SENSOR_HYDRAULICS_OUTLET ].data = (U32)getFPGAPnErrorCount(); -// lastPressureErrorCounter[ PRESSURE_SENSOR_BIBAG ].data = (U32)getFPGAPCbErrorCount(); -// lastPressureErrorCounter[ PRESSURE_SENSOR_SPENT_DIALYSATE ].data = (U32)getFPGAPDsErrorCount(); -// lastPressureErrorCounter[ PRESSURE_SENSOR_FRESH_DIALYSATE ].data = (U32)getFPGAPDfErrorCount(); -// lastPressureErrorCounter[ PRESSURE_SENSOR_TRANSMEMBRANE ].data = (U32)getFPGAPtmErrorCount(); -// + // 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() ); + + // Update and convert raw pressure sensor temperatures to deg C + currentPresTempReadings[ PRESSURE_SENSOR_WATER_INLET_PRE_REG ].data = convertPressureTempReading2DegC( getFPGAPRiRawTemperature() ); + currentPresTempReadings[ PRESSURE_SENSOR_WATER_INLET_POST_REG ].data = convertPressureTempReading2DegC( getFPGAPRoRawTemperature() ); + currentPresTempReadings[ PRESSURE_SENSOR_WATER_INLET_PRE_COND ].data = convertPressureTempReading2DegC( getFPGAPC2oRawTemperature() ); + currentPresTempReadings[ PRESSURE_SENSOR_PRE_RO_FILTER ].data = convertPressureTempReading2DegC( getFPGAPPoRawTemperature() ); + currentPresTempReadings[ PRESSURE_SENSOR_POST_RO_FILTER ].data = convertPressureTempReading2DegC( getFPGAPMpRawTemperature() ); + + // Update read and error counters for each pressure sensor + lastPressureReadCounter[ PRESSURE_SENSOR_WATER_INLET_PRE_REG ].data = (U32)getFPGAPRiReadCount(); + lastPressureReadCounter[ PRESSURE_SENSOR_WATER_INLET_POST_REG ].data = (U32)getFPGAPRoReadCount(); + lastPressureReadCounter[ PRESSURE_SENSOR_WATER_INLET_PRE_COND ].data = (U32)getFPGAPC2oReadCount(); + lastPressureReadCounter[ PRESSURE_SENSOR_PRE_RO_FILTER ].data = (U32)getFPGAPPoReadCount(); + lastPressureReadCounter[ PRESSURE_SENSOR_POST_RO_FILTER ].data = (U32)getFPGAPMpReadCount(); + + lastPressureErrorCounter[ PRESSURE_SENSOR_WATER_INLET_PRE_REG ].data = (U32)getFPGAPRiErrorCount(); + lastPressureErrorCounter[ PRESSURE_SENSOR_WATER_INLET_POST_REG ].data = (U32)getFPGAPRoErrorCount(); + lastPressureErrorCounter[ PRESSURE_SENSOR_WATER_INLET_PRE_COND ].data = (U32)getFPGAPC2oErrorCount(); + lastPressureErrorCounter[ PRESSURE_SENSOR_PRE_RO_FILTER ].data = (U32)getFPGAPPoErrorCount(); + lastPressureErrorCounter[ PRESSURE_SENSOR_POST_RO_FILTER ].data = (U32)getFPGAPMpErrorCount(); + // // Monitor pressure sensor health // checkPressureSensors(); } /*********************************************************************//** * @brief - * The convertBaroPressureReading2mmHg function converts the raw pressure counts - * in to mmHg unit. - * @details \b Inputs: FPGA - * @details \b Outputs: baroConvConsts - * @param rawPressure the raw baro sensor reading from FPGA. - * @return the converted baro pressure (in mmHg). - *************************************************************************/ -//static F32 convertBaroPressureReading2mmHg( U32 rawPressure ) -//{ -// F32 baroPressure = 0.0F; -// -// baroConvConsts.pressureSensitivity = getFPGABaroPressureSensitivity(); -// baroConvConsts.pressureSensitivityTempCoeff = getFPGABaroTempCoeffOfPressSensitvity(); -// baroConvConsts.pressureOffset = getFPGABaroPressureOffset(); -// baroConvConsts.pressureOffsetTempCoeff = getFPGABaroTempCoeffOfPressOffset(); -// baroPressure = calculateBaroPressure( rawPressure ); -// -// return baroPressure; -//} - -/*********************************************************************//** - * @brief - * The calculateBaroPressure function performs the required calculations - * to compute the baro pressure readings. - * @details \b Inputs: baroConvConsts - * @details \b Outputs: none - * @param pressure the raw baro sensor reading from FPGA. - * @return converted baro pressure (in mmHg). - *************************************************************************/ -//static F32 calculateBaroPressure( U32 pressure ) -//{ -// S32 tempDiff = getBaroSensorTemperatureDiff(); -// S64 tempOffset = ( baroConvConsts.pressureOffsetTempCoeff * tempDiff ) / TWO_TO_POWER_OF_6; -// S64 presOffset = baroConvConsts.pressureOffset * TWO_TO_POWER_OF_17; -// S64 offset = presOffset + tempOffset; -// S64 tempSensitivity = ( baroConvConsts.pressureSensitivityTempCoeff * tempDiff ) / TWO_TO_POWER_OF_7; -// S64 presSensitivity = baroConvConsts.pressureSensitivity * TWO_TO_POWER_OF_16; -// S64 sensitivity = tempSensitivity + presSensitivity; -// S32 pres = (S32)( ( ( pressure * sensitivity ) / TWO_TO_POWER_OF_21 ) - offset ) / TWO_TO_POWER_OF_15; -// F32 presmmHg = ( (F32)pres / (F32)( COUNTS_TO_MILLI_BAR * ONE_BAR_TO_MILLI_BAR ) ) * BAR_TO_MMHG; -// -// return presmmHg; -//} - -/*********************************************************************//** - * @brief * The checkPressureSensors function checks the read and error counters for * each pressure sensor. * @details \b Alarm: ALARM_ID_DD_HYD_OUTLET_PRES_TIMEOUT_FAULT if the @@ -265,122 +185,122 @@ * @brief * The getPressure function gets the current pressure (in mmHg) for a given * pressure sensor. - * @details \b Alarm: ALARM_ID_DD_SOFTWARE_FAULT if given sensor is invalid. + * @details \b Alarm: ALARM_ID_RO_SOFTWARE_FAULT if given pressure sensor is invalid. * @details \b Inputs: currentPressureReadings * @details \b Outputs: none * @param sensor ID of pressure sensor to get pressure reading for. * @return The current pressure (in mmHg) of the given pressure sensor. *************************************************************************/ -//F32 getPressure( PRESSURE_SENSORS_T sensor ) -//{ -// F32 result = 0.0F; -// -// if ( sensor < NUM_OF_PRESSURE_SENSORS ) -// { -// result = currentPressureReadings[ sensor ].data; -// if ( OVERRIDE_KEY == currentPressureReadings[ sensor ].override ) -// { -// result = currentPressureReadings[ sensor ].ovData; -// } -// } -// else -// { -// SET_ALARM_WITH_2_U32_DATA( ALARM_ID_DD_SOFTWARE_FAULT, SW_FAULT_ID_PRESSURE_SENSOR_INVALID_SENSOR1, sensor ) -// } -// -// return result; -//} +F32 getPressure( PRESSURE_SENSORS_T sensor ) +{ + F32 result = 0.0F; + if ( sensor < NUM_OF_PRESSURE_SENSORS ) + { + result = currentPressureReadings[ sensor ].data; + if ( OVERRIDE_KEY == currentPressureReadings[ sensor ].override ) + { + result = currentPressureReadings[ sensor ].ovData; + } + } + else + { + SET_ALARM_WITH_2_U32_DATA( ALARM_ID_RO_SOFTWARE_FAULT, SW_FAULT_ID_PRESSURE_SENSOR_INVALID_SENSOR1, (U32)sensor ) + } + + return result; +} + /*********************************************************************//** * @brief * The getPressureSensorTemperature function gets the current pressure sensor * temperature (in deg C) for a given pressure sensor. - * @details \b Alarm: ALARM_ID_DD_SOFTWARE_FAULT if given sensor is invalid. + * @details \b Alarm: ALARM_ID_RO_SOFTWARE_FAULT if given pressure sensor is invalid. * @details \b Inputs: currentPresTempReadings * @details \b Outputs: none * @param sensor ID of pressure sensor to get temperature reading for. * @return The current pressure sensor temperature (in deg C) of the given pressure sensor. *************************************************************************/ -//F32 getPressureSensorTemperature( PRESSURE_SENSORS_T sensor ) -//{ -// F32 result = 0.0F; -// -// if ( sensor < NUM_OF_PRESSURE_SENSORS ) -// { -// result = currentPresTempReadings[ sensor ].data; -// if ( OVERRIDE_KEY == currentPresTempReadings[ sensor ].override ) -// { -// result = currentPresTempReadings[ sensor ].ovData; -// } -// } -// else -// { -// SET_ALARM_WITH_2_U32_DATA( ALARM_ID_DD_SOFTWARE_FAULT, SW_FAULT_ID_PRESSURE_SENSOR_INVALID_SENSOR2, sensor ) -// } -// -// return result; -//} +F32 getPressureSensorTemperature( PRESSURE_SENSORS_T sensor ) +{ + F32 result = 0.0F; + if ( sensor < NUM_OF_PRESSURE_SENSORS ) + { + result = currentPresTempReadings[ sensor ].data; + if ( OVERRIDE_KEY == currentPresTempReadings[ sensor ].override ) + { + result = currentPresTempReadings[ sensor ].ovData; + } + } + else + { + SET_ALARM_WITH_2_U32_DATA( ALARM_ID_RO_SOFTWARE_FAULT, SW_FAULT_ID_PRESSURE_SENSOR_INVALID_SENSOR2, sensor ) + } + + return result; +} + /*********************************************************************//** * @brief * The getPressureSensorReadCount function gets the current pressure sensor * read count for a given pressure sensor. - * @details \b Alarm: ALARM_ID_DD_SOFTWARE_FAULT if given sensor is invalid. + * @details \b Alarm: ALARM_ID_RO_SOFTWARE_FAULT if given sensor is invalid. * @details \b Inputs: lastPressureReadCounter * @details \b Outputs: none * @param sensor ID of pressure sensor to get read count for. * @return The current pressure sensor read count of a given pressure sensor. *************************************************************************/ -//U32 getPressureSensorReadCount( PRESSURE_SENSORS_T sensor ) -//{ -// U32 result = 0; -// -// if ( sensor < NUM_OF_PRESSURE_SENSORS ) -// { -// result = lastPressureReadCounter[ sensor ].data; -// if ( OVERRIDE_KEY == lastPressureReadCounter[ sensor ].override ) -// { -// result = lastPressureReadCounter[ sensor ].ovData; -// } -// } -// else -// { -// SET_ALARM_WITH_2_U32_DATA( ALARM_ID_DD_SOFTWARE_FAULT, SW_FAULT_ID_PRESSURE_SENSOR_INVALID_SENSOR3, sensor ) -// } -// -// return result; -//} +U32 getPressureSensorReadCount( PRESSURE_SENSORS_T sensor ) +{ + U32 result = 0; + if ( sensor < NUM_OF_PRESSURE_SENSORS ) + { + result = lastPressureReadCounter[ sensor ].data; + if ( OVERRIDE_KEY == lastPressureReadCounter[ sensor ].override ) + { + result = lastPressureReadCounter[ sensor ].ovData; + } + } + else + { + SET_ALARM_WITH_2_U32_DATA( ALARM_ID_RO_SOFTWARE_FAULT, SW_FAULT_ID_PRESSURE_SENSOR_INVALID_SENSOR3, sensor ) + } + + return result; +} + /*********************************************************************//** * @brief * The getPressureSensorErrorCount function gets the current pressure sensor * error count for a given pressure sensor. - * @details \b Alarm: ALARM_ID_DD_SOFTWARE_FAULT if given sensor is invalid. + * @details \b Alarm: ALARM_ID_RO_SOFTWARE_FAULT if given sensor is invalid. * @details \b Inputs: lastPressureErrorCounter * @details \b Outputs: none * @param sensor ID of pressure sensor to get error count for. * @return The current pressure sensor error count of a given pressure sensor. *************************************************************************/ -//U32 getPressureSensorErrorCount( PRESSURE_SENSORS_T sensor ) -//{ -// U32 result = 0; -// -// if ( sensor < NUM_OF_PRESSURE_SENSORS ) -// { -// result = lastPressureErrorCounter[ sensor ].data; -// if ( OVERRIDE_KEY == lastPressureErrorCounter[ sensor ].override ) -// { -// result = lastPressureErrorCounter[ sensor ].ovData; -// } -// } -// else -// { -// SET_ALARM_WITH_2_U32_DATA( ALARM_ID_DD_SOFTWARE_FAULT, SW_FAULT_ID_PRESSURE_SENSOR_INVALID_SENSOR4, sensor ) -// } -// -// return result; -//} +U32 getPressureSensorErrorCount( PRESSURE_SENSORS_T sensor ) +{ + U32 result = 0; + if ( sensor < NUM_OF_PRESSURE_SENSORS ) + { + result = lastPressureErrorCounter[ sensor ].data; + if ( OVERRIDE_KEY == lastPressureErrorCounter[ sensor ].override ) + { + result = lastPressureErrorCounter[ sensor ].ovData; + } + } + else + { + SET_ALARM_WITH_2_U32_DATA( ALARM_ID_RO_SOFTWARE_FAULT, SW_FAULT_ID_PRESSURE_SENSOR_INVALID_SENSOR4, sensor ) + } + + return result; +} + /************************************************************************* * TEST SUPPORT FUNCTIONS @@ -389,70 +309,70 @@ /*********************************************************************//** * @brief - * The testPressureSensorReadingsOverride function overrides the value of the - * specified pressure sensor with a given value. + * The testPressureSensorReadingsOverride function overrides the value of + * the specified 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. * @return TRUE if override successful, FALSE if not *************************************************************************/ -//BOOL testPressureSensorReadingsOverride( MESSAGE_T *message ) -//{ -// BOOL result = f32ArrayOverride( message, ¤tPressureReadings[0], NUM_OF_PRESSURE_SENSORS - 1 ); -// -// return result; -//} +BOOL testPressureSensorReadingsOverride( MESSAGE_T *message ) +{ + BOOL result = f32ArrayOverride( message, ¤tPressureReadings[0], NUM_OF_PRESSURE_SENSORS - 1 ); + + return result; +} /*********************************************************************//** * @brief - * The testPressureSensorTemperatureReadingsOverride function overrides the value of the - * specified pressure sensor temperature with a given value. + * The testPressureSensorTemperatureReadingsOverride function overrides the + * value of the specified 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. * @return TRUE if override successful, FALSE if not *************************************************************************/ -//BOOL testPressureSensorTemperatureReadingsOverride( MESSAGE_T *message ) -//{ -// BOOL result = f32ArrayOverride( message, ¤tPresTempReadings[0], NUM_OF_PRESSURE_SENSORS - 1 ); -// -// return result; -//} +BOOL testPressureSensorTemperatureReadingsOverride( MESSAGE_T *message ) +{ + BOOL result = f32ArrayOverride( message, ¤tPresTempReadings[0], NUM_OF_PRESSURE_SENSORS - 1 ); + return result; +} + /*********************************************************************//** * @brief - * The testPressureSensorReadCounterOverride function overrides the value of the - * specified pressure sensor read counter with a given value. + * The testPressureSensorReadCounterOverride function overrides the value + * of the specified pressure sensor read counter with a given value. * @details \b Inputs: none * @details \b Outputs: lastPressureReadCounter[] * @param message Override message from Dialin which includes an sensor * ID and override value of the pressure sensor read counter. * @return TRUE if override successful, FALSE if not *************************************************************************/ -//BOOL testPressureSensorReadCounterOverride( MESSAGE_T *message ) -//{ -// BOOL result = u32ArrayOverride( message, &lastPressureReadCounter[0], NUM_OF_PRESSURE_SENSORS - 1, 0, PRES_SENSORS_READ_ERR_MAX_CNT ); -// -// return result; -//} +BOOL testPressureSensorReadCounterOverride( MESSAGE_T *message ) +{ + BOOL result = u32ArrayOverride( message, &lastPressureReadCounter[0], NUM_OF_PRESSURE_SENSORS - 1, 0, PRES_SENSORS_READ_ERR_MAX_CNT ); + return result; +} + /*********************************************************************//** * @brief - * The testPressureSensorErrorCounterOverride function overrides the value of the - * specified pressure sensor error counter with a given value. + * The testPressureSensorErrorCounterOverride function overrides the value + * of the specified pressure sensor error counter with a given value. * @details \b Inputs: none * @details \b Outputs: lastPressureErrorCounter[] * @param message Override message from Dialin which includes an sensor * ID and override value of the pressure sensor error counter. * @return TRUE if override successful, FALSE if not *************************************************************************/ -//BOOL testPressureSensorErrorCounterOverride( MESSAGE_T *message ) -//{ -// BOOL result = u32ArrayOverride( message, &lastPressureErrorCounter[0], NUM_OF_PRESSURE_SENSORS - 1, 0, PRES_SENSORS_READ_ERR_MAX_CNT ); -// -// return result; -//} +BOOL testPressureSensorErrorCounterOverride( MESSAGE_T *message ) +{ + BOOL result = u32ArrayOverride( message, &lastPressureErrorCounter[0], NUM_OF_PRESSURE_SENSORS - 1, 0, PRES_SENSORS_READ_ERR_MAX_CNT ); + + return result; +} /**@}*/