Index: firmware/App/Services/AlarmMgmt.c =================================================================== diff -u -r5d82009d1baa2b52122065934481745bf4de223b -r92d1230313c92c7480b9ae80a37b7a594232f59d --- firmware/App/Services/AlarmMgmt.c (.../AlarmMgmt.c) (revision 5d82009d1baa2b52122065934481745bf4de223b) +++ firmware/App/Services/AlarmMgmt.c (.../AlarmMgmt.c) (revision 92d1230313c92c7480b9ae80a37b7a594232f59d) @@ -40,6 +40,8 @@ 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. + // ********** private data ********** static BOOL alarmIsActive[ NUM_OF_ALARM_IDS ]; ///< Array of current state of each alarm @@ -333,4 +335,44 @@ return result; } +/*********************************************************************//** + * @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. + * @details Inputs: none + * @details Outputs: alarmIsActive[], alarmStartedAt[] + * @param key 32-bit supervior alarm key required to perform this function + * @return TRUE if override reset successful, FALSE if not + *************************************************************************/ +BOOL testClearAllAlarms( U32 key ) +{ + BOOL result = FALSE; + + // Verify key + if ( SUPERVISOR_ALARM_KEY == key ) + { + // Verify tester has logged in with HD + if ( TRUE == isTestingActivated() ) + { + ALARM_ID_T a; + + // Clear all active alarms + for ( a = ALARM_ID_NO_ALARM; a < NUM_OF_ALARM_IDS; a++ ) + { + if ( TRUE == alarmIsActive[ a ] ) + { + U32 al = (U32)a; + + broadcastData( MSG_ID_ALARM_CLEARED, COMM_BUFFER_OUT_CAN_DG_ALARM, (U08*)&al, sizeof( U32 ) ); + alarmIsActive[ a ] = FALSE; + } + } + result = TRUE; + } + } + + return result; +} + /**@}*/