Index: firmware/App/Controllers/AirTrap.c =================================================================== diff -u -r4d509fa074423027c3106a209ead0beffd57cc3e -rda757a96fa3b5756a2cc6321cc851af9a2cfcf09 --- firmware/App/Controllers/AirTrap.c (.../AirTrap.c) (revision 4d509fa074423027c3106a209ead0beffd57cc3e) +++ firmware/App/Controllers/AirTrap.c (.../AirTrap.c) (revision da757a96fa3b5756a2cc6321cc851af9a2cfcf09) @@ -37,7 +37,9 @@ #define AIR_TRAP_DATA_PUB_INTERVAL ( MS_PER_SECOND / TASK_GENERAL_INTERVAL ) ///< Interval (ms/task time) at which the air trap data is published on the CAN bus. #define AIR_TRAP_FILL_TIMEOUT_MS ( 6 * MS_PER_SECOND ) ///< Air trap fill timeout period (in ms). -#define AIR_PUMP_UPPER_LEVEL_PERSISTENCE ( 100 / TASK_GENERAL_INTERVAL ) ///< Persistence time for air pump operation after air trap upper level reads air. +#define AIR_PUMP_UPPER_LEVEL_PERSISTENCE ( 300 / TASK_GENERAL_INTERVAL ) ///< Persistence time for air pump operation after air trap upper level reads air. +#define AIR_PUMP_ON_ERROR_MAX_CNT 6 ///< Maximum number of air pump on events within time window before alarm triggered. Do not exceed MAX_TIME_WINDOWED_COUNT. +#define AIR_PUMP_ON_ERROR_TIME_WIN_MS ( 60 * MS_PER_SECOND ) ///< Time window for Air Pump on count error. /// Persistence period for illegal level sensors fault. static const U32 AIR_TRAP_ILLEGAL_LEVELS_PERSISTENCE = ( MS_PER_SECOND * 2 / TASK_GENERAL_INTERVAL ); @@ -101,6 +103,9 @@ airTrapLevels[i].ovInitData = 0; airTrapLevels[i].override = OVERRIDE_RESET; } + + // TODO DMC - enable windowed counter init when new alarm added + //initTimeWindowedCount( TIME_WINDOWED_COUNT_AIR_PUMP_ERROR, AIR_PUMP_ON_ERROR_MAX_CNT, AIR_PUMP_ON_ERROR_TIME_WIN_MS ); } /*********************************************************************//** @@ -335,9 +340,15 @@ { if ( AIR_PUMP_STATE_OFF == getAirPumpState() ) { + // TODO DMC - Check Air pump window counter here + //if ( TRUE == incTimeWindowedCount( TIME_WINDOWED_COUNT_AIR_PUMP_ERROR ) ) + //{ + // activateAlarmNoData( ALARM_ID_HD_AIR_PUMP_ON_ERROR ); + //} + setAirPumpState( AIR_PUMP_STATE_ON ); airPumpUpperLevelCtr = 0; - signalInitiatePressureStabilization(); + signalInitiatePressureStabilization( TRUE ); } }