Index: firmware/App/Services/AlarmMgmt.c =================================================================== diff -u -rde5a0d43bdef611d963d11855bc958a8d8899a09 -rde169e7374f6c7a737995ac8c6c3953dc5c75aa7 --- firmware/App/Services/AlarmMgmt.c (.../AlarmMgmt.c) (revision de5a0d43bdef611d963d11855bc958a8d8899a09) +++ firmware/App/Services/AlarmMgmt.c (.../AlarmMgmt.c) (revision de169e7374f6c7a737995ac8c6c3953dc5c75aa7) @@ -61,7 +61,7 @@ const ALARM_T alarmTable[ NUM_OF_ALARM_IDS ] = { // Priority Escalate In Escalate To Fault Stops NoClr NoRes NoRin NoEnd NoNew Bypass { ALARM_PRIORITY_NONE, 0, ALARM_ID_NO_ALARM, FALSE, FALSE, FALSE, FALSE, FALSE, FALSE, FALSE, FALSE }, // ALARM_ID_NO_ALARM - { ALARM_PRIORITY_HIGH, 0, ALARM_ID_NO_ALARM, TRUE , TRUE , TRUE , TRUE , TRUE , TRUE , TRUE , FALSE }, // ALARM_ID_SOFTWARE_FAULT + { ALARM_PRIORITY_HIGH, 0, ALARM_ID_NO_ALARM, TRUE , TRUE , TRUE , TRUE , TRUE , TRUE , TRUE , FALSE }, // ALARM_ID_HD_SOFTWARE_FAULT { ALARM_PRIORITY_HIGH, 0, ALARM_ID_NO_ALARM, TRUE , TRUE , TRUE , TRUE , TRUE , TRUE , TRUE , FALSE }, // ALARM_ID_STUCK_BUTTON_TEST_FAILED { ALARM_PRIORITY_HIGH, 0, ALARM_ID_NO_ALARM, TRUE , TRUE , TRUE , TRUE , TRUE , TRUE , TRUE , FALSE }, // ALARM_ID_FPGA_POST_TEST_FAILED { ALARM_PRIORITY_HIGH, 0, ALARM_ID_NO_ALARM, TRUE , TRUE , TRUE , TRUE , TRUE , TRUE , TRUE , FALSE }, // ALARM_ID_WATCHDOG_POST_TEST_FAILED @@ -118,32 +118,52 @@ { ALARM_PRIORITY_HIGH, ALM_ESC_4_MIN, ALARM_ID_BLOOD_SITTING_WARNING, FALSE, TRUE , FALSE, FALSE, FALSE, FALSE, FALSE, FALSE }, // ALARM_ID_BLOOD_PUMP_MOTOR_SPEED_CHECK { ALARM_PRIORITY_HIGH, ALM_ESC_4_MIN, ALARM_ID_BLOOD_SITTING_WARNING, FALSE, TRUE , FALSE, FALSE, FALSE, FALSE, FALSE, FALSE }, // ALARM_ID_DIAL_IN_PUMP_MOTOR_SPEED_CHECK { ALARM_PRIORITY_HIGH, ALM_ESC_4_MIN, ALARM_ID_BLOOD_SITTING_WARNING, FALSE, TRUE , FALSE, FALSE, FALSE, FALSE, FALSE, FALSE }, // ALARM_ID_DIAL_OUT_PUMP_MOTOR_SPEED_CHECK - { ALARM_PRIORITY_HIGH, ALM_ESC_4_MIN, ALARM_ID_BLOOD_SITTING_WARNING, FALSE, TRUE , FALSE, FALSE, FALSE, FALSE, FALSE, FALSE }, // ALARM_ID_BLOOD_PUMP_ROTOR_SPEED_TOO_HIGH + { ALARM_PRIORITY_HIGH, ALM_ESC_4_MIN, ALARM_ID_BLOOD_SITTING_WARNING, FALSE, TRUE , FALSE, FALSE, FALSE, FALSE, FALSE, FALSE }, // ALARM_ID_BLOOD_PUMP_ROTOR_SPEED_TOO_HIGH + { ALARM_PRIORITY_MEDIUM, ALM_ESC_4_MIN, ALARM_ID_BLOOD_SITTING_WARNING, FALSE, TRUE , FALSE, FALSE, FALSE, FALSE, FALSE, FALSE }, // ALARM_ID_INLET_WATER_LOW_CONDUCTIVITY + { ALARM_PRIORITY_MEDIUM, ALM_ESC_4_MIN, ALARM_ID_BLOOD_SITTING_WARNING, FALSE, TRUE , FALSE, FALSE, FALSE, FALSE, FALSE, FALSE }, // ALARM_ID_INLET_WATER_HIGH_CONDUCTIVITY + { ALARM_PRIORITY_HIGH, 0, ALARM_ID_NO_ALARM, TRUE , TRUE , TRUE , TRUE , TRUE , TRUE , TRUE , FALSE }, // ALARM_ID_DG_SOFTWARE_FAULT + { ALARM_PRIORITY_HIGH, 0, ALARM_ID_NO_ALARM, TRUE , TRUE , TRUE , TRUE , TRUE , TRUE , TRUE , FALSE }, // ALARM_ID_CONDUCTIVITY_SENSOR_FAULT + { ALARM_PRIORITY_HIGH, 0, ALARM_ID_NO_ALARM, TRUE , TRUE , TRUE , TRUE , TRUE , TRUE , TRUE , FALSE }, // ALARM_ID_INLET_WATER_LOW_TEMPERATURE + { ALARM_PRIORITY_HIGH, 0, ALARM_ID_NO_ALARM, TRUE , TRUE , TRUE , TRUE , TRUE , TRUE , TRUE , FALSE }, // ALARM_ID_INLET_WATER_HIGH_TEMPERATURE + { ALARM_PRIORITY_HIGH, 0, ALARM_ID_NO_ALARM, TRUE , TRUE , TRUE , TRUE , TRUE , TRUE , TRUE , FALSE }, // ALARM_ID_PRESSURE_SENSOR_FAULT + { ALARM_PRIORITY_HIGH, 0, ALARM_ID_NO_ALARM, TRUE , TRUE , TRUE , TRUE , TRUE , TRUE , TRUE , FALSE }, // ALARM_ID_INLET_WATER_LOW_PRESSURE + { ALARM_PRIORITY_HIGH, 0, ALARM_ID_NO_ALARM, TRUE , TRUE , TRUE , TRUE , TRUE , TRUE , TRUE , FALSE }, // ALARM_ID_CRITICAL_DATA_ERROR + { ALARM_PRIORITY_HIGH, 0, ALARM_ID_NO_ALARM, TRUE , TRUE , TRUE , TRUE , TRUE , TRUE , TRUE , FALSE }, // ALARM_ID_HD_ACCELEROMETER_SELF_TEST_FAILURE + { ALARM_PRIORITY_HIGH, 0, ALARM_ID_NO_ALARM, TRUE , TRUE , TRUE , TRUE , TRUE , TRUE , TRUE , FALSE }, // ALARM_ID_DG_ACCELEROMETER_SELF_TEST_FAILURE + { ALARM_PRIORITY_HIGH, ALM_ESC_4_MIN, ALARM_ID_BLOOD_SITTING_WARNING, FALSE, TRUE , FALSE, FALSE, FALSE, FALSE, FALSE, FALSE }, // ALARM_ID_HD_EXCESSIVE_TILT + { ALARM_PRIORITY_HIGH, ALM_ESC_4_MIN, ALARM_ID_BLOOD_SITTING_WARNING, FALSE, TRUE , FALSE, FALSE, FALSE, FALSE, FALSE, FALSE }, // ALARM_ID_DG_EXCESSIVE_TILT + { ALARM_PRIORITY_HIGH, ALM_ESC_4_MIN, ALARM_ID_BLOOD_SITTING_WARNING, FALSE, TRUE , FALSE, FALSE, FALSE, FALSE, FALSE, FALSE }, // ALARM_ID_HD_SHOCK + { ALARM_PRIORITY_HIGH, ALM_ESC_4_MIN, ALARM_ID_BLOOD_SITTING_WARNING, FALSE, TRUE , FALSE, FALSE, FALSE, FALSE, FALSE, FALSE }, // ALARM_ID_DG_SHOCK + { ALARM_PRIORITY_HIGH, 0, ALARM_ID_NO_ALARM, TRUE , TRUE , TRUE , TRUE , TRUE , TRUE , TRUE , FALSE }, // ALARM_ID_HD_ACCELEROMETER_FAILURE + { ALARM_PRIORITY_HIGH, 0, ALARM_ID_NO_ALARM, TRUE , TRUE , TRUE , TRUE , TRUE , TRUE , TRUE , FALSE }, // ALARM_ID_DG_ACCELEROMETER_FAILURE + { ALARM_PRIORITY_HIGH, 0, ALARM_ID_NO_ALARM, TRUE , TRUE , TRUE , TRUE , TRUE , TRUE , TRUE , FALSE }, // ALARM_ID_DG_CRITICAL_DATA_ERROR + { ALARM_PRIORITY_HIGH, ALM_ESC_4_MIN, ALARM_ID_BLOOD_SITTING_WARNING, FALSE, TRUE , FALSE, FALSE, FALSE, FALSE, FALSE, FALSE }, // ALARM_ID_RO_REJECTION_RATIO_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_INLET_WATER_PRESSURE_FAULT }; /// A blank alarm data record for alarms that do not include alarm data when triggered. const ALARM_DATA_T blankAlarmData = { ALARM_DATA_TYPE_NONE, 0 }; // pin assignment for backup alarm audio enable -#define BACKUP_AUDIO_ENABLE_SPI3_PORT_MASK 0x00000001 // (SPI3-CS0 - re-purposed as output GPIO) +#define BACKUP_AUDIO_ENABLE_SPI3_PORT_MASK 0x00000001 ///< pin SPI3-CS0 - re-purposed as output GPIO for back audio enable. // backup alarm audio enable/disable macros -#define SET_BACKUP_AUDIO_ENABLE() {mibspiREG3->PC3 |= BACKUP_AUDIO_ENABLE_SPI3_PORT_MASK;} -#define CLR_BACKUP_AUDIO_ENABLE() {mibspiREG3->PC3 &= ~BACKUP_AUDIO_ENABLE_SPI3_PORT_MASK;} +#define SET_BACKUP_AUDIO_ENABLE() {mibspiREG3->PC3 |= BACKUP_AUDIO_ENABLE_SPI3_PORT_MASK;} ///< Macro to enable backup alarm audio. +#define CLR_BACKUP_AUDIO_ENABLE() {mibspiREG3->PC3 &= ~BACKUP_AUDIO_ENABLE_SPI3_PORT_MASK;} ///< Macro to disable backup alarm audio. // ********** private data ********** /// interval (in ms) at which to publish alarm status to CAN bus DATA_DECL( U32, AlarmStatusPub, alarmStatusPublishInterval, ALARM_STATUS_PUBLISH_INTERVAL, ALARM_STATUS_PUBLISH_INTERVAL ); -static U32 alarmStatusPublicationTimerCounter = 0; ///< Used to schedule alarm status publication to CAN bus. +static U32 alarmStatusPublicationTimerCounter = 0; ///< Used to schedule alarm status publication to CAN bus. /// table - current state of each alarm static BOOL alarmIsActive[ NUM_OF_ALARM_IDS ]; /// table - when alarm became active for each alarm (if active) or zero (if inactive) DATA_ARRAY_DECL( U32, AlarmStarts, NUM_OF_ALARM_IDS, alarmStartedAt ); -static COMP_ALARM_STATUS_T alarmStatus; ///< Record for the current composite alarm status. +static COMP_ALARM_STATUS_T alarmStatus; ///< Record for the current composite alarm status. -static ALARM_ID_T alarmPriorityFIFO[ NUM_OF_ALARM_PRIORITIES ]; +static ALARM_ID_T alarmPriorityFIFO[ NUM_OF_ALARM_PRIORITIES ]; ///< FIFO - first activated alarm in each alarm priority category. // ********** private function prototypes ********** @@ -160,13 +180,12 @@ static DATA_ARRAY_GET_PROTOTYPE( U32, getAlarmStartTime, alarmID ); static DATA_GET_PROTOTYPE( U32, getPublishAlarmStatusInterval ); -/************************************************************************* - * @brief initAlarmMgmt +/*********************************************************************//** + * @brief * The initAlarmMgmt function initializes the AlarmMgmt module. * @details * Inputs : none * Outputs : AlarmMgmt module initialized. - * @param none * @return none *************************************************************************/ void initAlarmMgmt( void ) @@ -208,15 +227,14 @@ alarmStatus.bypassDialyzer = FALSE; } -/************************************************************************* - * @brief execAlarmMgmt - * The execAlarmMgmt function executes the alarm management functions to be \n - * done periodically. The composite alarm state is updated, alarm lamp and \n +/*********************************************************************//** + * @brief + * The execAlarmMgmt function executes the alarm management functions to be + * done periodically. The composite alarm state is updated, alarm lamp and * audio patterns are updated, and status is sent out to the rest of the system. * @details - * Inputs : larmStatusTable[], alarmTable[] - * Outputs : larmStatus - * @param none + * Inputs : alarmStatusTable[], alarmTable[] + * Outputs : alarmStatus * @return none *************************************************************************/ void execAlarmMgmt( void ) @@ -234,13 +252,13 @@ } } -/************************************************************************* - * @brief activateAlarm +/*********************************************************************//** + * @brief * The activateAlarm function activates a given alarm. * @details * Inputs : none * Outputs : alarmIsActive[], alarmStartedAt[] - * @param alarm : ID of alarm to activate + * @param alarm ID of alarm to activate * @return none *************************************************************************/ static void activateAlarm( ALARM_ID_T alarm ) @@ -267,20 +285,19 @@ } else { - SET_ALARM_WITH_2_U32_DATA( ALARM_ID_SOFTWARE_FAULT, SW_FAULT_ID_ALARM_MGMT_INVALID_ALARM_TO_ACTIVATE, alarm ) + SET_ALARM_WITH_2_U32_DATA( ALARM_ID_HD_SOFTWARE_FAULT, SW_FAULT_ID_ALARM_MGMT_INVALID_ALARM_TO_ACTIVATE, alarm ) } } -/************************************************************************* - * @brief activateAlarmNoData - * The activateAlarmNoData function activates a given alarm. Also, an alarm \n - * message is broadcast to the rest of the system. This function will \n +/*********************************************************************//** + * @brief + * The activateAlarmNoData function activates a given alarm. Also, an alarm + * message is broadcast to the rest of the system. This function will * include given data in the broadcast message for logging. * @details * Inputs : none * Outputs : alarm triggered message sent, alarm activated - * @param alarm : ID of alarm to activate - * @param alarmData : supporting data to include in alarm msg + * @param alarm ID of alarm to activate * @return none *************************************************************************/ void activateAlarmNoData( ALARM_ID_T alarm ) @@ -293,26 +310,28 @@ activateAlarm( alarm ); #ifdef DEBUG_ENABLED #ifdef ALARMS_DEBUG - { - // TODO - temporary debug code - remove later - char debugStr[ 256 ]; - sprintf( debugStr, "ALARM triggered:%5d \n", alarm ); - sendDebugData( (U08*)debugStr, strlen(debugStr) ); - } + if ( FALSE == alarmIsActive[ alarm ] ) + { + // TODO - temporary debug code - remove later + char debugStr[ 256 ]; + sprintf( debugStr, "ALARM trig:%5d \n", alarm ); + sendDebugData( (U08*)debugStr, strlen(debugStr) ); + sendDebugDataToUI( (U08*)debugStr ); + } #endif #endif } -/************************************************************************* - * @brief activateAlarm1Data - * The activateAlarm1Data function activates a given alarm. Also, an alarm \n - * message is broadcast to the rest of the system. This function will \n +/*********************************************************************//** + * @brief + * The activateAlarm1Data function activates a given alarm. Also, an alarm + * message is broadcast to the rest of the system. This function will * include given data in the broadcast message for logging. * @details * Inputs : none * Outputs : alarm triggered message sent, alarm activated - * @param alarm : ID of alarm to activate - * @param alarmData : supporting data to include in alarm msg + * @param alarm ID of alarm to activate + * @param alarmData supporting data to include in alarm msg * @return none *************************************************************************/ void activateAlarm1Data( ALARM_ID_T alarm, ALARM_DATA_T alarmData ) @@ -325,27 +344,29 @@ activateAlarm( alarm ); #ifdef DEBUG_ENABLED #ifdef ALARMS_DEBUG - { - // TODO - temporary debug code - remove later - char debugStr[ 256 ]; - sprintf( debugStr, "ALARM triggered:%5d %8X \n", alarm, alarmData.data.uInt.data ); - sendDebugData( (U08*)debugStr, strlen(debugStr) ); - } + if ( FALSE == alarmIsActive[ alarm ] ) + { + // TODO - temporary debug code - remove later + char debugStr[ 256 ]; + sprintf( debugStr, "ALARM trig:%5d %8X \n", alarm, alarmData.data.uInt.data ); + sendDebugData( (U08*)debugStr, strlen(debugStr) ); + sendDebugDataToUI( (U08*)debugStr ); + } #endif #endif } -/************************************************************************* - * @brief activateAlarm1Data - * The activateAlarm2Data function activates a given alarm. Also, an alarm \n - * message is broadcast to the rest of the system. This function will \n +/*********************************************************************//** + * @brief + * The activateAlarm2Data function activates a given alarm. Also, an alarm + * message is broadcast to the rest of the system. This function will * include two given data in the broadcast message for logging. * @details * Inputs : none * Outputs : alarm triggered message sent, alarm activated - * @param alarm : ID of alarm to activate - * @param alarmData1 : supporting data to include in alarm msg - * @param alarmData2 : supporting data to include in alarm msg + * @param alarm ID of alarm to activate + * @param alarmData1 supporting data to include in alarm msg + * @param alarmData2 supporting data to include in alarm msg * @return none *************************************************************************/ void activateAlarm2Data( ALARM_ID_T alarm, ALARM_DATA_T alarmData1, ALARM_DATA_T alarmData2 ) @@ -358,24 +379,26 @@ activateAlarm( alarm ); #ifdef DEBUG_ENABLED #ifdef ALARMS_DEBUG - { - // TODO - temporary debug code - remove later - char debugStr[ 256 ]; - sprintf( debugStr, "ALARM triggered:%5d %8X %8X \n", (S32)alarm, alarmData1.data.uInt.data, alarmData2.data.uInt.data ); - sendDebugData( (U08*)debugStr, strlen(debugStr) ); - } + if ( FALSE == alarmIsActive[ alarm ] ) + { + // TODO - temporary debug code - remove later + char debugStr[ 256 ]; + sprintf( debugStr, "ALARM trig:%5d %8X %8X \n", (S32)alarm, alarmData1.data.uInt.data, alarmData2.data.uInt.data ); + sendDebugData( (U08*)debugStr, strlen(debugStr) ); + sendDebugDataToUI( (U08*)debugStr ); + } #endif #endif } -/************************************************************************* - * @brief clearAlarm - * The clearAlarm function clears a given alarm if it is recoverable. Also \n +/*********************************************************************//** + * @brief + * The clearAlarm function clears a given alarm if it is recoverable. Also * an alarm message is broadcast to the rest of the system. * @details * Inputs : none * Outputs : AlarmStatusTable[] - * @param alarm : ID of alarm to clear + * @param alarm ID of alarm to clear * @return none *************************************************************************/ void clearAlarm( ALARM_ID_T alarm ) @@ -404,6 +427,7 @@ char debugStr[ 256 ]; sprintf( debugStr, "ALARM cleared:%5d \n", alarm ); sendDebugData( (U08*)debugStr, strlen(debugStr) ); + sendDebugDataToUI( (U08*)debugStr ); } #endif #endif @@ -412,18 +436,18 @@ } else { - SET_ALARM_WITH_2_U32_DATA( ALARM_ID_SOFTWARE_FAULT, SW_FAULT_ID_ALARM_MGMT_INVALID_ALARM_TO_CLEAR, alarm ) + SET_ALARM_WITH_2_U32_DATA( ALARM_ID_HD_SOFTWARE_FAULT, SW_FAULT_ID_ALARM_MGMT_INVALID_ALARM_TO_CLEAR, alarm ) } } -/************************************************************************* - * @brief isAlarmActive - * The isAlarmActive function determines whether a given alarm is currently \n +/*********************************************************************//** + * @brief + * The isAlarmActive function determines whether a given alarm is currently * active. * @details * Inputs : alarmIsActive[] * Outputs : none - * @param alarmID : ID of alarm to check + * @param alarm ID of alarm to check * @return TRUE if given alarm is active, FALSE if not *************************************************************************/ BOOL isAlarmActive( ALARM_ID_T alarm ) @@ -433,25 +457,45 @@ return result; } -/************************************************************************* - * @brief getAlarmStartTime +/*********************************************************************//** + * @brief * The getAlarmStartTime function gets the active state of a given alarm. * @details * Inputs : alarmStartedAt[] * Outputs : none - * @param alarmID : ID of alarm to check + * @param alarmID ID of alarm to check * @return The start time stamp of given alarm ID *************************************************************************/ -static DATA_ARRAY_GET( U32, getAlarmStartTime, alarmID, NUM_OF_ALARM_IDS-1, alarmStartedAt, 0 ) +U32 getAlarmStartTime( U32 alarmID ) +{ + U32 result = 0; + + if ( alarmID < NUM_OF_ALARM_IDS ) + { + if ( OVERRIDE_KEY == alarmStartedAt[ alarmID ].override ) + { + result = alarmStartedAt[ alarmID ].ovData; + } + else + { + result = alarmStartedAt[ alarmID ].data; + } + } + else + { + activateAlarmNoData( ALARM_ID_HD_SOFTWARE_FAULT ); + } + + return result; +} -/************************************************************************* - * @brief updateAlarmsState - * The updateAlarmsState function updates the alarms state and alarm to \n +/*********************************************************************//** + * @brief + * The updateAlarmsState function updates the alarms state and alarm to * display. * @details * Inputs : alarmStatusTable[] * Outputs : alarmPriorityFIFO[], alarmStatus - * @param none * @return none *************************************************************************/ static void updateAlarmsState( void ) @@ -484,14 +528,13 @@ alarmStatus.systemFault = faultsActive; } -/************************************************************************* - * @brief setAlarmLampAndAudio - * The setAlarmLampAndAudio function sets the alarm lamp and audio patterns \n +/*********************************************************************//** + * @brief + * The setAlarmLampAndAudio function sets the alarm lamp and audio patterns * according to the current state of alarms. * @details * Inputs : none * Outputs : Alarm lamp patter set according to current alarms status. - * @param none * @return none *************************************************************************/ static void setAlarmLampAndAudio( void ) @@ -525,7 +568,7 @@ default: requestAlarmLampPattern( LAMP_PATTERN_FAULT ); - SET_ALARM_WITH_2_U32_DATA( ALARM_ID_SOFTWARE_FAULT, SW_FAULT_ID_ALARM_MGMT_LAMP_INVALID_ALARM_STATE, alarmStatus.alarmsState ) + SET_ALARM_WITH_2_U32_DATA( ALARM_ID_HD_SOFTWARE_FAULT, SW_FAULT_ID_ALARM_MGMT_LAMP_INVALID_ALARM_STATE, alarmStatus.alarmsState ) break; } } @@ -556,19 +599,18 @@ default: // TODO - high priority audio - SET_ALARM_WITH_2_U32_DATA( ALARM_ID_SOFTWARE_FAULT, SW_FAULT_ID_ALARM_MGMT_LAMP_INVALID_ALARM_STATE, alarmStatus.alarmsState ) + SET_ALARM_WITH_2_U32_DATA( ALARM_ID_HD_SOFTWARE_FAULT, SW_FAULT_ID_ALARM_MGMT_LAMP_INVALID_ALARM_STATE, alarmStatus.alarmsState ) break; } } } -/************************************************************************* - * @brief updateAlarmsSilenceStatus +/*********************************************************************//** + * @brief * The updateAlarmsSilenceStatus function updates the alarms silence state. * @details * Inputs : alarmStatus * Outputs : alarmStatus - * @param none * @return none *************************************************************************/ static void updateAlarmsSilenceStatus( void ) @@ -599,13 +641,12 @@ } } -/************************************************************************* - * @brief handleAlarmEscalations +/*********************************************************************//** + * @brief * The handleAlarmEscalations function handles alarm escalation. * @details - * Inputs : none - * Outputs : none - * @param none + * Inputs : alarmIsActive[], alarmTable[] + * Outputs : alarm(s) escalated when appropriate * @return none *************************************************************************/ static void handleAlarmEscalations( void ) @@ -662,14 +703,13 @@ } } -/************************************************************************* - * @brief updateAlarmsFlags - * The updateAlarmsFlags function updates the alarms flags of the alarms \n +/*********************************************************************//** + * @brief + * The updateAlarmsFlags function updates the alarms flags of the alarms * status record. * @details * Inputs : none - * Outputs : none - * @param none + * Outputs : alarmStatus * @return none *************************************************************************/ static void updateAlarmsFlags( void ) @@ -718,14 +758,14 @@ alarmStatus.bypassDialyzer = bypassDialyzer; } -/************************************************************************* - * @brief resetAlarmPriorityFIFO - * The resetAlarmPriorityFIFO function resets a FIFO for a given alarm \n +/*********************************************************************//** + * @brief + * The resetAlarmPriorityFIFO function resets a FIFO for a given alarm * priority. * @details * Inputs : none * Outputs : alarmPriorityFIFO[] - * @param priority : priority of FIFO to reset + * @param priority priority of FIFO to reset * @return none *************************************************************************/ static void resetAlarmPriorityFIFO( ALARM_PRIORITY_T priority ) @@ -737,38 +777,45 @@ } else { - SET_ALARM_WITH_2_U32_DATA( ALARM_ID_SOFTWARE_FAULT, SW_FAULT_ID_ALARM_MGMT_INVALID_FIFO_TO_RESET, priority ) + SET_ALARM_WITH_2_U32_DATA( ALARM_ID_HD_SOFTWARE_FAULT, SW_FAULT_ID_ALARM_MGMT_INVALID_FIFO_TO_RESET, priority ) } } -/************************************************************************* - * @brief getPublishAlarmStatusInterval - * The getPublishAlarmStatusInterval function gets the alarm status \n +/*********************************************************************//** + * @brief + * The getPublishAlarmStatusInterval function gets the alarm status * publication interval. * @details * Inputs : alarmStatusPublishInterval * Outputs : none - * @param none * @return the current alarm status publication interval (in ms). *************************************************************************/ -DATA_GET( U32, getPublishAlarmStatusInterval, alarmStatusPublishInterval ) +U32 getPublishAlarmStatusInterval( void ) +{ + U32 result = alarmStatusPublishInterval.data; + + if ( OVERRIDE_KEY == alarmStatusPublishInterval.override ) + { + result = alarmStatusPublishInterval.ovData; + } + + return result; +} -/**@}*/ - /************************************************************************* * TEST SUPPORT FUNCTIONS *************************************************************************/ -/************************************************************************* - * @brief testSetAlarmStatusPublishIntervalOverride - * The testSetAlarmStatusPublishIntervalOverride function overrides the \n +/*********************************************************************//** + * @brief + * The testSetAlarmStatusPublishIntervalOverride function overrides the * alarm status publish interval. * @details * Inputs : none * Outputs : alarmStatusPublishInterval - * @param value : override blood flow data publish interval with (in ms) + * @param value override blood flow data publish interval with (in ms) * @return TRUE if override successful, FALSE if not *************************************************************************/ BOOL testSetAlarmStatusPublishIntervalOverride( U32 value ) @@ -787,9 +834,9 @@ return result; } -/************************************************************************* - * @brief testResetAlarmStatusPublishIntervalOverride - * The testResetAlarmStatusPublishIntervalOverride function resets the override \n +/*********************************************************************//** + * @brief + * The testResetAlarmStatusPublishIntervalOverride function resets the override * of the alarm status publish interval. * @details * Inputs : none @@ -810,16 +857,16 @@ return result; } -/************************************************************************* +/*********************************************************************//** * @brief - * The testSetAlarmStateOverride function overrides the state of the \n - * alarm active state for a given alarm with the alarm management with \n + * The testSetAlarmStateOverride function overrides the state of the + * alarm active state for a given alarm with the alarm management with * a given active state. * @details * Inputs : none * Outputs : alarm activated or cleared - * @param alarmID : ID of alarm to activate or clear - * @param value : override state for the given alarm ID (1=activate, 0=clear) + * @param alarmID ID of alarm to activate or clear + * @param value override state for the given alarm ID (1=activate, 0=clear) * @return TRUE if override successful, FALSE if not *************************************************************************/ BOOL testSetAlarmStateOverride( U32 alarmID, U32 state ) @@ -845,14 +892,14 @@ return result; } -/************************************************************************* +/*********************************************************************//** * @brief - * The testResetAlarmStateOverride function resets the override of the \n + * The testResetAlarmStateOverride function resets the override of the * state of the active state for a given alarm with the alarm management. * @details * Inputs : none * Outputs : alarm cleared - * @param alarmID : ID of alarm to clear + * @param alarmID ID of alarm to clear * @return TRUE if alarm clear successful, FALSE if not *************************************************************************/ BOOL testResetAlarmStateOverride( U32 alarmID ) @@ -871,15 +918,15 @@ return result; } -/************************************************************************* - * @brief testSetAlarmStartOverride - * The testSetAlarmStartOverride function overrides the start time \n - * for a given alarm with the alarm management with a given start time. \n +/*********************************************************************//** + * @brief + * The testSetAlarmStartOverride function overrides the start time + * for a given alarm with the alarm management with a given start time. * @details * Inputs : none * Outputs : alarmStartedAt[] - * @param alarmID : ID of alarm to override start time for - * @param value : override time since start (in ms) for the given alarm ID + * @param alarmID ID of alarm to override start time for + * @param value override time since start (in ms) for the given alarm ID * @return TRUE if override successful, FALSE if not *************************************************************************/ BOOL testSetAlarmStartOverride( U32 alarmID, U32 value ) @@ -904,14 +951,14 @@ return result; } -/************************************************************************* - * @brief testResetAlarmStartOverride - * The testResetAlarmStartOverride function resets the override of the \n +/*********************************************************************//** + * @brief + * The testResetAlarmStartOverride function resets the override of the * start time for a given alarm with the alarm management. * @details * Inputs : none * Outputs : alarmStartedAt[] - * @param alarmID : ID of alarm to reset override of start time for + * @param alarmID ID of alarm to reset override of start time for * @return TRUE if override reset successful, FALSE if not *************************************************************************/ BOOL testResetAlarmStartOverride( U32 alarmID ) @@ -930,5 +977,5 @@ return result; } - - + +/**@}*/