Index: firmware/App/Controllers/Pressures.c =================================================================== diff -u -r117bbf0b189fd61be822f6705002a702490a94ed -r44c977966ab7cfecbfbf5110e6abe4ec45ebab62 --- firmware/App/Controllers/Pressures.c (.../Pressures.c) (revision 117bbf0b189fd61be822f6705002a702490a94ed) +++ firmware/App/Controllers/Pressures.c (.../Pressures.c) (revision 44c977966ab7cfecbfbf5110e6abe4ec45ebab62) @@ -14,7 +14,6 @@ * @date (original) 04-Apr-2020 * ***************************************************************************/ -#include #include "AlarmMgmt.h" #include "FPGA.h" @@ -40,9 +39,6 @@ #define PRESSURE_SAMPLES_TO_AVERAGE (200 / TASK_PRIORITY_INTERVAL) ///< Averaging pressure data over the reporting interval. #define PRESSURE_AVERAGE_MULTIPLIER (1.0 / (F32)PRESSURE_SAMPLES_TO_AVERAGE) ///< Optimization - multiplying is faster than dividing. -#define PRESSURE_SENSORS_ADC_BITS 12U ///< Pressure sensors ADC bits. -#define PRESSURE_SENSORS_ADC_MAX_COUNT ( pow(2, PRESSURE_SENSORS_ADC_BITS) - 1 ) ///< Pressure sensors max ADC count. - #define MIN_INLET_WATER_PRESSURE 25 ///< Minimum water input pressure. #define INLET_WATER_PRESSURE_PERSISTENCE_COUNT ( 5 * MS_PER_SECOND / TASK_GENERAL_INTERVAL ) ///< Persistence count for pressure out of range error. #define PRESSURES_DATA_PUB_INTERVAL ( MS_PER_SECOND / TASK_PRIORITY_INTERVAL ) ///< Interval (ms/task time) at which the pressures data is published on the CAN bus. @@ -390,7 +386,7 @@ SELF_TEST_STATUS_T result = SELF_TEST_STATUS_PASSED; U16 const inletPressureADCReading = getIntADCReading( INT_ADC_RO_PUMP_INLET_PRESSURE ); - if ( ( inletPressureADCReading == 0 ) || ( inletPressureADCReading >= PRESSURE_SENSORS_ADC_MAX_COUNT ) ) + if ( ( inletPressureADCReading == 0 ) || ( inletPressureADCReading >= INT_ADC_FULL_SCALE_BITS ) ) { result = SELF_TEST_STATUS_FAILED; SET_ALARM_WITH_1_U32_DATA( ALARM_ID_PRESSURE_SENSOR_FAULT, inletPressureADCReading ); @@ -404,6 +400,7 @@ * TEST SUPPORT FUNCTIONS *************************************************************************/ + /*********************************************************************//** * @brief * The testSetPressuresDataPublishIntervalOverride function overrides the