Index: firmware/App/Services/AlarmMgmtDD.c =================================================================== diff -u -r26ee1d67dca19aac1850077cbd41c05498cf059d -r262381341fba476bb71f5cf0d67ac2fe17dee9c6 --- firmware/App/Services/AlarmMgmtDD.c (.../AlarmMgmtDD.c) (revision 26ee1d67dca19aac1850077cbd41c05498cf059d) +++ firmware/App/Services/AlarmMgmtDD.c (.../AlarmMgmtDD.c) (revision 262381341fba476bb71f5cf0d67ac2fe17dee9c6) @@ -16,38 +16,34 @@ ***************************************************************************/ #include "AlarmMgmtDD.h" +#include "Messaging.h" #include "OperationModes.h" #include "PersistentAlarm.h" #include "SafetyShutdown.h" -#include "TaskGeneral.h" -#include "Timers.h" -#include "Messaging.h" -#include "TDDefs.h" #include "SystemCommDD.h" +#include "TaskGeneral.h" +#include "TDDefs.h" +#include "Timers.h" + /** * @addtogroup AlarmManagement * @{ */ // ********** private definitions ********** -/// Interval (ms/task time) at which the alarm information is published on the CAN bus. -#define ALARM_INFO_PUB_INTERVAL ( MS_PER_SECOND / TASK_GENERAL_INTERVAL ) +#define ALARM_INFO_PUB_INTERVAL ( MS_PER_SECOND / TASK_GENERAL_INTERVAL ) /// Interval (ms/task time) at which the alarm information is published on the CAN bus. #define DATA_PUBLISH_COUNTER_START_COUNT 12 ///< Data publish counter start count. -#define ALARM_DG_FAULT_LED_ON_INTERVAL ( MS_PER_SECOND / 4 / TASK_GENERAL_INTERVAL ) ///< LED Flash ON time interval time -#define ALARM_DG_FAULT_LED_OFF_INTERVAL ( ALARM_DG_FAULT_LED_ON_INTERVAL * 2 ) ///< LED Flash OFF time interval time - -U32 alarmLEDTimer; ///< Alarm LED timer +#define SUPERVISOR_ALARM_KEY 0xD2C3B4A5 ///< 32-bit key required for clear all alarms request. -const ALARM_DATA_T BLANK_ALARM_DATA = { ALARM_DATA_TYPE_NONE, 0 }; ///< A blank alarm data record for alarms that do not include alarm data when triggered. - -#define SUPERVISOR_ALARM_KEY 0xD2C3B4A5 ///< 32-bit key required for clear all alarms request. +const ALARM_DATA_T BLANK_ALARM_DATA = { ALARM_DATA_TYPE_NONE, 0 }; ///< A blank alarm data record for alarms that do not include alarm data when triggered. // ********** private data ********** static U32 alarmInfoPublicationTimerCounter; ///< Used to schedule alarm information publication to CAN bus. -static BOOL isAFaultAlarmActive; ///< Boolean flag to indicate whether a DG fault alarm is active. +static BOOL isAFaultAlarmActive; ///< Boolean flag to indicate whether a DD fault alarm is active. + /// Interval (in task intervals) at which to publish alarm information to CAN bus. static OVERRIDE_U32_T alarmInfoPublishInterval = { ALARM_INFO_PUB_INTERVAL, ALARM_INFO_PUB_INTERVAL, ALARM_INFO_PUB_INTERVAL, 0 }; @@ -61,14 +57,12 @@ * @brief * The initAlarmMgmtDD function initializes the AlarmMgmt module. * @details \b Inputs: none - * @details \b Outputs: alarmInfoPublicationTimerCounter, alarmLEDTimer, - * isAFaultAlarmActive, alarmIsActive, alarmIsDetected + * @details \b Outputs: unit variables initialized. * @return none *************************************************************************/ void initAlarmMgmtDD( void ) { alarmInfoPublicationTimerCounter = DATA_PUBLISH_COUNTER_START_COUNT; - alarmLEDTimer = 0; isAFaultAlarmActive = FALSE; // Initialize common alarm mgmt unit @@ -77,7 +71,7 @@ /*********************************************************************//** * @brief - * The execAlarmMgmt function executes the alarm management module. + * The execAlarmMgmt function executes periodic alarm management operations. * @details \b Inputs: none * @details \b Outputs: none * @return none @@ -111,14 +105,14 @@ // activate alarm activateAlarm( alarm ); - if ( TRUE == props.alarmIsDGFault ) + if ( TRUE == props.alarmIsDDFault ) { - // There is a DG fault alarm. + // There is a DD fault alarm. isAFaultAlarmActive = TRUE; if ( TRUE == isTransitionToFaultRequired() ) { - // If alarm is a DG fault and the alarm manager can transition to fault immediately, go to fault mode + // If alarm is a DD fault and the alarm manager can transition to fault immediately, go to fault mode requestNewOperationMode( DD_MODE_FAUL ); } } @@ -167,7 +161,9 @@ * is broadcast to the rest of the system. This function will include * two given data in the broadcast message for logging. * @details \b Inputs: none - * @details \b Outputs: alarm triggered message sent, alarm activated + * @details \b Outputs: alarm triggered message sent, alarm activated + * @details \b Message \b sent: MSG_ID_ALARM_TRIGGERED to update Alarm + * trigerred details along with the supporting data. * @param alarm ID of alarm to activate * @param alarmData1 supporting data to include in alarm message * @param alarmData2 supporting data to include in alarm message @@ -200,6 +196,8 @@ * An alarm message is broadcast to the rest of the system. * @details \b Inputs: none * @details \b Outputs: AlarmStatusTable[] + * @details \b Message \Sent: MSG_ID_ALARM_CLEARED to update clearance of + * the alarm. * @details \b Alarm: ALARM_ID_DD_SOFTWARE_FAULT when invalid alarm needs * to be cleared. * @param alarm ID of alarm to clear @@ -212,8 +210,8 @@ // verify given alarm if ( ( alarm > ALARM_ID_NO_ALARM ) && ( alarm < NUM_OF_ALARM_IDS ) ) { - // clear alarm and broadcast alarm clear if not already cleared (and not a DG fault which should not be cleared) - if ( ( TRUE == isAlarmActive( alarm ) ) && ( props.alarmIsDGFault != TRUE ) ) + // clear alarm and broadcast alarm clear if not already cleared (and not a DD fault which should not be cleared) + if ( ( TRUE == isAlarmActive( alarm ) ) && ( props.alarmIsDDFault != TRUE ) ) { if ( TRUE == isTDCommunicating() ) { @@ -235,6 +233,8 @@ * flag. Also an alarm message is broadcast to the rest of the system. * @details \b Inputs: none * @details \b Outputs: alarmIsDetected[] + * @details \b Message \b Sent: MSG_ID_ALARM_CONDITION_CLEARED to update + * alarm condition clearance. * @details \b Alarm: ALARM_ID_DD_SOFTWARE_FAULT when invalid alarm conditioned * needs to be cleared * @param alarm ID of alarm to clear condition for @@ -280,6 +280,8 @@ * interval. * @details \b Inputs: * @details \b Outputs: alarm information are published to CAN bus. + * @details \b Message \b Sent: MSG_ID_DD_ALARM_INFO_DATA to puslish saftey + * shutdown activation details. * @return none *************************************************************************/ static void publishAlarmInfo( void ) @@ -292,7 +294,6 @@ data.safetyShutdownStatus = (U32)isSafetyShutdownActivated(); broadcastData( MSG_ID_DD_ALARM_INFO_DATA, COMM_BUFFER_OUT_CAN_DD_ALARM, (U08*)&data, sizeof( SAFETY_SHUTDOWN_ACTIVATION_DATA_T ) ); - //broadcastCPLDStatus(); alarmInfoPublicationTimerCounter = 0; } } @@ -303,6 +304,7 @@ * all active alarms. * @details \b Inputs: alarmIsActive[] * @details \b Outputs: re-send active alarms to UI +* @details \b Message \b Sent: MSG_ID_ALARM_TRIGGERED to resend all active alarms. * @return none *************************************************************************/ void handleResendActiveAlarmsRequest( void ) @@ -331,12 +333,12 @@ BOOL status = FALSE; // Check all the inlet water conditions -// status |= isAlarmActive( ALARM_ID_DG_CLEANING_MODE_INLET_WATER_TEMP_TOO_HIGH ); -// status |= isAlarmActive( ALARM_ID_DG_CLEANING_MODE_INLET_WATER_TEMP_TOO_LOW ); -// status |= isAlarmActive( ALARM_ID_DG_CLEANING_MODE_INLET_WATER_COND_TOO_HIGH ); -// status |= isAlarmActive( ALARM_ID_DG_CLEANING_MODE_INLET_WATER_COND_TOO_LOW ); -// status |= isAlarmActive( ALARM_ID_DG_CLEANING_MODE_INLET_WATER_PRESSURE_TOO_HIGH ); -// status |= isAlarmActive( ALARM_ID_DG_CLEANING_MODE_INLET_WATER_PRESSURE_TOO_LOW ); +// status |= isAlarmActive( ALARM_ID_DD_CLEANING_MODE_INLET_WATER_TEMP_TOO_HIGH ); +// status |= isAlarmActive( ALARM_ID_DD_CLEANING_MODE_INLET_WATER_TEMP_TOO_LOW ); +// status |= isAlarmActive( ALARM_ID_DD_CLEANING_MODE_INLET_WATER_COND_TOO_HIGH ); +// status |= isAlarmActive( ALARM_ID_DD_CLEANING_MODE_INLET_WATER_COND_TOO_LOW ); +// status |= isAlarmActive( ALARM_ID_DD_CLEANING_MODE_INLET_WATER_PRESSURE_TOO_HIGH ); +// status |= isAlarmActive( ALARM_ID_DD_CLEANING_MODE_INLET_WATER_PRESSURE_TOO_LOW ); return status; } @@ -356,11 +358,9 @@ switch( opMode ) { - //case DG_MODE_FLUS: + //case DD_MODE_FLUS: case DD_MODE_HEAT: - //case DG_MODE_CHEM: case DD_MODE_SERV: - //case DG_MODE_CHFL: case DD_MODE_HCOL: case DD_MODE_ROPS: status = FALSE; @@ -382,9 +382,10 @@ * @brief * The testClearAllAlarms function clears all active alarms, even if they * are non-recoverable or faults. The caller of this function must provide - * the correct 32-bit key. A Dialin user must also be logged into DG. + * the correct 32-bit key. A Dialin user must also be logged into DD. * @details \b Inputs: none * @details \b Outputs: alarmIsActive[], alarmStartedAt[] + * @details \b Message \b Sent: MSG_ID_ALARM_CLEARED to clear all alarms. * @param key 32-bit supervisor alarm key required to perform this function * @return TRUE if override reset successful, FALSE if not *************************************************************************/