Index: firmware/App/Services/AlarmMgmt.c =================================================================== diff -u -rf8feb10a7e19e17148e4ce8b247316c9772d1753 -r5e77f78c5dee9dfb441bd5d2053f7f4ac50dc619 --- firmware/App/Services/AlarmMgmt.c (.../AlarmMgmt.c) (revision f8feb10a7e19e17148e4ce8b247316c9772d1753) +++ firmware/App/Services/AlarmMgmt.c (.../AlarmMgmt.c) (revision 5e77f78c5dee9dfb441bd5d2053f7f4ac50dc619) @@ -37,7 +37,9 @@ #define ALM_ESC_1_MIN (1 * SEC_PER_MIN * MS_PER_SECOND) ///< Number of ms in 1 minute. #define ALM_ESC_4_MIN (4 * SEC_PER_MIN * MS_PER_SECOND) ///< Number of ms in 4 minutes. #define ALM_ESC_5_MIN (5 * SEC_PER_MIN * MS_PER_SECOND) ///< Number of ms in 5 minutes. -#define ALM_ESC_10_MIN (10 * SEC_PER_MIN * MS_PER_SECOND) ///< Number of ms in 10 minutes. +#define ALM_ESC_10_MIN (10 * SEC_PER_MIN * MS_PER_SECOND) ///< Number of ms in 10 minutes. + +#define SUPERVISOR_ALARM_KEY 0xD2C3B4A5 ///< 32-bit key required for clear all alarms request. #pragma pack(push,1) /// Record defining the properties of each individual alarm. @@ -153,6 +155,10 @@ { ALARM_PRIORITY_HIGH, 0, ALARM_ID_NO_ALARM, TRUE , TRUE , TRUE , TRUE , TRUE , TRUE , TRUE , FALSE }, // ALARM_ID_SALINE_BOLUS_VOLUME_CHECK_FAILURE { ALARM_PRIORITY_HIGH, 0, ALARM_ID_NO_ALARM, TRUE , TRUE , TRUE , TRUE , TRUE , TRUE , TRUE , FALSE }, // ALARM_ID_ARTERIAL_PRESSURE_SENSOR_FAULT { ALARM_PRIORITY_HIGH, 0, ALARM_ID_NO_ALARM, TRUE , TRUE , TRUE , TRUE , TRUE , TRUE , TRUE , FALSE }, // ALARM_ID_VENOUS_PRESSURE_SENSOR_FAULT + { ALARM_PRIORITY_HIGH, 0, ALARM_ID_NO_ALARM, TRUE , TRUE , TRUE , TRUE , TRUE , TRUE , TRUE , FALSE }, // ALARM_ID_UV_REACTOR_NOT_HEALTHY + { ALARM_PRIORITY_HIGH, ALM_ESC_4_MIN, ALARM_ID_BLOOD_SITTING_WARNING, FALSE, TRUE , FALSE, FALSE, FALSE, FALSE, FALSE, FALSE }, // ALARM_ID_POST_ACID_CONDUCTIVITY_OUT_OF_RANGE + { ALARM_PRIORITY_HIGH, ALM_ESC_4_MIN, ALARM_ID_BLOOD_SITTING_WARNING, FALSE, TRUE , FALSE, FALSE, FALSE, FALSE, FALSE, FALSE }, // ALARM_ID_POST_BICARB_CONDUCTIVITY_OUT_OF_RANGE + { ALARM_PRIORITY_HIGH, 0, ALARM_ID_NO_ALARM, TRUE , TRUE , TRUE , TRUE , TRUE , TRUE , TRUE , FALSE }, // ALARM_ID_RO_PUMP_FLOW_RATE_OUT_OF_RANGE }; // *** This declaration will cause a compiler error if alarmTable does not have same # of alarms as the Alarm_List enumeration. @@ -839,6 +845,7 @@ { BOOL result = FALSE; + // verify tester has logged in with HD if ( TRUE == isTestingActivated() ) { U32 intvl = value / TASK_GENERAL_INTERVAL; @@ -864,6 +871,7 @@ { BOOL result = FALSE; + // verify tester has logged in with HD if ( TRUE == isTestingActivated() ) { result = TRUE; @@ -892,6 +900,7 @@ if ( alarmID < NUM_OF_ALARM_IDS ) { + // verify tester has logged in with HD if ( TRUE == isTestingActivated() ) { if ( TRUE == state ) @@ -925,6 +934,7 @@ if ( alarmID < NUM_OF_ALARM_IDS ) { + // verify tester has logged in with HD if ( TRUE == isTestingActivated() ) { result = TRUE; @@ -952,6 +962,7 @@ if ( alarmID < NUM_OF_ALARM_IDS ) { + // verify tester has logged in with HD if ( TRUE == isTestingActivated() ) { U32 tim = getMSTimerCount(); @@ -984,6 +995,7 @@ if ( alarmID < NUM_OF_ALARM_IDS ) { + // verify tester has logged in with HD if ( TRUE == isTestingActivated() ) { result = TRUE; @@ -993,6 +1005,51 @@ } 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 HD. + * @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 ] ) + { + broadcastAlarmCleared( a ); + alarmIsActive[ a ] = FALSE; + alarmStartedAt[ a ].data = 0; + // clear FIFO if this alarm was in it + if ( alarmPriorityFIFO[ alarmTable[ a ].alarmPriority ] == a ) + { + resetAlarmPriorityFIFO( alarmTable[ a ].alarmPriority ); + } + } + } + + result = TRUE; + } + } + + return result; } /**@}*/