Index: firmware/App/Monitors/WaterQualityMonitor.c =================================================================== diff -u -r6fb6727e92ee4d4a6d78f0c5bee872014af1bcea -r76ede35cf15c9310c2915151f1d47998f22b71de --- firmware/App/Monitors/WaterQualityMonitor.c (.../WaterQualityMonitor.c) (revision 6fb6727e92ee4d4a6d78f0c5bee872014af1bcea) +++ firmware/App/Monitors/WaterQualityMonitor.c (.../WaterQualityMonitor.c) (revision 76ede35cf15c9310c2915151f1d47998f22b71de) @@ -58,6 +58,7 @@ #define INLET_WATER_COND_OUT_OF_RANGE_TIMEOUT_MS ( 5 * MS_PER_SECOND ) ///< Persistence period for conductivity out of range error in milliseconds. #define INLET_WATER_COND_OUT_OF_RANGE_CLEAR_MS ( 5 * MS_PER_SECOND ) ///< Persistence period for conductivity out of range clear in milliseconds. #define INLET_CONDUCTIVITY_HIGH_THRESHOLD_US 2000.0F ///< Maximum allowed outlet conductivity in uS/cm. +#define MIN_RO_REJECTION_RATIO_PCT 90.0F ///< Minimum RO rejection ration in percentage // ********** private data ********** @@ -261,6 +262,25 @@ checkPersistentAlarm( ALARM_ID_FP_RO_OUTLET_CONDUCTIVITY_HIGH_RANGE, isConductivityOutOfLowRange, conductivityP18, OUTLET_CONDUCTIVITY_HIGH_THRESHOLD_US ); } +/*********************************************************************//** + * @brief + * The checkRORejectionRatio function checks the RO rejection ratio + * alarm if the rejection ratio is out of range. + * @details \b Inputs: roRRAvg + * @details \b Outputs: none + * @details \b Alarms: ALARM_ID_FP_REJECTION_RATIO_LOW_RANGE when + * RO rejection ratio goes below allowed rejection ratio limit. + * @return none + *************************************************************************/ +void checkRORejectionRatio( void ) +{ + F32 avgRORR = getRORRAverage(); + // Alarm if the filtered average is less than allowed RO rejection limit + if ( avgRORR < MIN_RO_REJECTION_RATIO_PCT ) + { + SET_ALARM_WITH_2_U32_DATA( ALARM_ID_FP_REJECTION_RATIO_LOW_RANGE, avgRORR, MIN_RO_REJECTION_RATIO_PCT) + } +} /************************************************************************* * TEST SUPPORT FUNCTIONS