Index: firmware/App/Services/AlarmMgmt.c =================================================================== diff -u -rf6888c7e4e05cb84b11fceb4340458d8af543ce8 -r0fce4283f8f28da957f9e82ec121efbc6ee55241 --- firmware/App/Services/AlarmMgmt.c (.../AlarmMgmt.c) (revision f6888c7e4e05cb84b11fceb4340458d8af543ce8) +++ firmware/App/Services/AlarmMgmt.c (.../AlarmMgmt.c) (revision 0fce4283f8f28da957f9e82ec121efbc6ee55241) @@ -79,6 +79,9 @@ /// FIFO - first activated or highest sub-rank alarm in each alarm priority category. static ALARM_PRIORITY_RANKS_T alarmPriorityFIFO[ NUM_OF_ALARM_PRIORITIES ]; +/// alarm user recovery actions enabled flags. +static BOOL alarmUserRecoveryActionEnabled[ NUMBER_OF_ALARM_USER_ACTIONS ]; + static U32 alarmAudioVolumeLevel = MAX_ALARM_VOLUME_LEVEL; ///< Set alarm audio volume level (0..7). // ********** private function prototypes ********** @@ -339,6 +342,28 @@ /*********************************************************************//** * @brief + * The setAlarmUserActionEnabled function enables/disables specific alarm + * recovery user actions while in specific modes. + * @details Inputs: none + * @details Outputs: + * @param action ID of user alarm recovery action to enable/disable + * @param enabled set to TRUE to enable action, FALSE to disable + * @return none + *************************************************************************/ +void setAlarmUserActionEnabled( ALARM_USER_ACTION_T action, BOOL enabled ) +{ + if ( action < NUMBER_OF_ALARM_USER_ACTIONS ) + { + alarmUserRecoveryActionEnabled[ action ] = enabled; + } + else + { + SET_ALARM_WITH_2_U32_DATA( ALARM_ID_HD_SOFTWARE_FAULT, SW_FAULT_ID_ALARM_MGMT_INVALID_USER_ACTION, (U32)action ) + } +} + +/*********************************************************************//** + * @brief * The signalAlarmUserActionInitiated function clears all non-recoverable alarms * and initiates selected user action. * @details Inputs: none @@ -800,13 +825,22 @@ { systemFault = ( TRUE == ALARM_TABLE[ a ].alarmIsFault ? TRUE : systemFault ); stop = ( TRUE == ALARM_TABLE[ a ].alarmStops ? TRUE : stop ); - noClear = ( TRUE == ALARM_TABLE[ a ].alarmNoClear ? TRUE : noClear ); - noResume = ( TRUE == ALARM_TABLE[ a ].alarmNoResume ? TRUE : noResume ); - noRinseback = ( TRUE == ALARM_TABLE[ a ].alarmNoRinseback ? TRUE : noRinseback ); - noEndTreatment = ( TRUE == ALARM_TABLE[ a ].alarmNoEndTreatment ? TRUE : noEndTreatment ); - noNewTreatment = ( TRUE == ALARM_TABLE[ a ].alarmNoNewTreatment ? TRUE : noNewTreatment ); - bypassDialyzer = ( TRUE == ALARM_TABLE[ a ].alarmDialyzerBypass ? TRUE : bypassDialyzer ); - + noClear = ( TRUE == ALARM_TABLE[ a ].alarmNoClear ? TRUE : noClear ); + noNewTreatment = ( TRUE == ALARM_TABLE[ a ].alarmNoNewTreatment ? TRUE : noNewTreatment ); + bypassDialyzer = ( TRUE == ALARM_TABLE[ a ].alarmDialyzerBypass ? TRUE : bypassDialyzer ); + // set user alarm recovery actions allowed flags + if ( TRUE == alarmUserRecoveryActionEnabled[ ALARM_USER_ACTION_RESUME ] ) + { + noResume = ( TRUE == ALARM_TABLE[ a ].alarmNoResume ? TRUE : noResume ); + } + if ( TRUE == alarmUserRecoveryActionEnabled[ ALARM_USER_ACTION_RINSEBACK ] ) + { + noRinseback = ( TRUE == ALARM_TABLE[ a ].alarmNoRinseback ? TRUE : noRinseback ); + } + if ( TRUE == alarmUserRecoveryActionEnabled[ ALARM_USER_ACTION_END_TREATMENT ] ) + { + noEndTreatment = ( TRUE == ALARM_TABLE[ a ].alarmNoEndTreatment ? TRUE : noEndTreatment ); + } } // if alarm active } // alarm table loop