Index: firmware/App/Modes/ModeFault.c =================================================================== diff -u -rf6888c7e4e05cb84b11fceb4340458d8af543ce8 -r0fce4283f8f28da957f9e82ec121efbc6ee55241 --- firmware/App/Modes/ModeFault.c (.../ModeFault.c) (revision f6888c7e4e05cb84b11fceb4340458d8af543ce8) +++ firmware/App/Modes/ModeFault.c (.../ModeFault.c) (revision 0fce4283f8f28da957f9e82ec121efbc6ee55241) @@ -56,7 +56,11 @@ *************************************************************************/ void transitionToFaultMode( void ) { - // TODO - anything to do here? + // set user alarm recovery actions allowed in this mode + setAlarmUserActionEnabled( ALARM_USER_ACTION_RESUME, FALSE ); + setAlarmUserActionEnabled( ALARM_USER_ACTION_RINSEBACK, FALSE ); + setAlarmUserActionEnabled( ALARM_USER_ACTION_END_TREATMENT, FALSE ); + } /*********************************************************************//** Index: firmware/App/Modes/ModeInitPOST.c =================================================================== diff -u -rf6888c7e4e05cb84b11fceb4340458d8af543ce8 -r0fce4283f8f28da957f9e82ec121efbc6ee55241 --- firmware/App/Modes/ModeInitPOST.c (.../ModeInitPOST.c) (revision f6888c7e4e05cb84b11fceb4340458d8af543ce8) +++ firmware/App/Modes/ModeInitPOST.c (.../ModeInitPOST.c) (revision 0fce4283f8f28da957f9e82ec121efbc6ee55241) @@ -72,6 +72,10 @@ *************************************************************************/ void transitionToInitAndPOSTMode( void ) { + // set user alarm recovery actions allowed in this mode + setAlarmUserActionEnabled( ALARM_USER_ACTION_RESUME, TRUE ); + setAlarmUserActionEnabled( ALARM_USER_ACTION_RINSEBACK, FALSE ); + setAlarmUserActionEnabled( ALARM_USER_ACTION_END_TREATMENT, FALSE ); } /*********************************************************************//** Index: firmware/App/Modes/ModePostTreat.c =================================================================== diff -u -rf6888c7e4e05cb84b11fceb4340458d8af543ce8 -r0fce4283f8f28da957f9e82ec121efbc6ee55241 --- firmware/App/Modes/ModePostTreat.c (.../ModePostTreat.c) (revision f6888c7e4e05cb84b11fceb4340458d8af543ce8) +++ firmware/App/Modes/ModePostTreat.c (.../ModePostTreat.c) (revision 0fce4283f8f28da957f9e82ec121efbc6ee55241) @@ -57,6 +57,11 @@ *************************************************************************/ void transitionToPostTreatmentMode( void ) { + // set user alarm recovery actions allowed in this mode + setAlarmUserActionEnabled( ALARM_USER_ACTION_RESUME, TRUE ); + setAlarmUserActionEnabled( ALARM_USER_ACTION_RINSEBACK, FALSE ); + setAlarmUserActionEnabled( ALARM_USER_ACTION_END_TREATMENT, FALSE ); + #ifdef RM46_EVAL_BOARD_TARGET start = getMSTimerCount(); #endif Index: firmware/App/Modes/ModePreTreat.c =================================================================== diff -u -rf6888c7e4e05cb84b11fceb4340458d8af543ce8 -r0fce4283f8f28da957f9e82ec121efbc6ee55241 --- firmware/App/Modes/ModePreTreat.c (.../ModePreTreat.c) (revision f6888c7e4e05cb84b11fceb4340458d8af543ce8) +++ firmware/App/Modes/ModePreTreat.c (.../ModePreTreat.c) (revision 0fce4283f8f28da957f9e82ec121efbc6ee55241) @@ -80,6 +80,11 @@ { BOOL stop = isStopButtonPressed(); + // set user alarm recovery actions allowed in this mode + setAlarmUserActionEnabled( ALARM_USER_ACTION_RESUME, TRUE ); + setAlarmUserActionEnabled( ALARM_USER_ACTION_RINSEBACK, FALSE ); + setAlarmUserActionEnabled( ALARM_USER_ACTION_END_TREATMENT, TRUE ); + #ifndef DISABLE_UI_TREATMENT_WORKFLOW if ( TRUE == treatStartReqReceived ) #endif Index: firmware/App/Modes/ModeService.c =================================================================== diff -u -rf6888c7e4e05cb84b11fceb4340458d8af543ce8 -r0fce4283f8f28da957f9e82ec121efbc6ee55241 --- firmware/App/Modes/ModeService.c (.../ModeService.c) (revision f6888c7e4e05cb84b11fceb4340458d8af543ce8) +++ firmware/App/Modes/ModeService.c (.../ModeService.c) (revision 0fce4283f8f28da957f9e82ec121efbc6ee55241) @@ -47,6 +47,11 @@ *************************************************************************/ void transitionToServiceMode( void ) { + // set user alarm recovery actions allowed in this mode + setAlarmUserActionEnabled( ALARM_USER_ACTION_RESUME, TRUE ); + setAlarmUserActionEnabled( ALARM_USER_ACTION_RINSEBACK, FALSE ); + setAlarmUserActionEnabled( ALARM_USER_ACTION_END_TREATMENT, FALSE ); + } /*********************************************************************//** Index: firmware/App/Modes/ModeStandby.c =================================================================== diff -u -rf6888c7e4e05cb84b11fceb4340458d8af543ce8 -r0fce4283f8f28da957f9e82ec121efbc6ee55241 --- firmware/App/Modes/ModeStandby.c (.../ModeStandby.c) (revision f6888c7e4e05cb84b11fceb4340458d8af543ce8) +++ firmware/App/Modes/ModeStandby.c (.../ModeStandby.c) (revision 0fce4283f8f28da957f9e82ec121efbc6ee55241) @@ -78,6 +78,11 @@ initDGInterface(); resetAirTrap(); + // set user alarm recovery actions allowed in this mode + setAlarmUserActionEnabled( ALARM_USER_ACTION_RESUME, TRUE ); + setAlarmUserActionEnabled( ALARM_USER_ACTION_RINSEBACK, FALSE ); + setAlarmUserActionEnabled( ALARM_USER_ACTION_END_TREATMENT, FALSE ); + // pumps should be off setBloodPumpTargetFlowRate( 0, MOTOR_DIR_FORWARD, PUMP_CONTROL_MODE_CLOSED_LOOP ); setDialInPumpTargetFlowRate( 0, MOTOR_DIR_FORWARD, PUMP_CONTROL_MODE_CLOSED_LOOP ); Index: firmware/App/Modes/ModeTreatment.c =================================================================== diff -u -rf6888c7e4e05cb84b11fceb4340458d8af543ce8 -r0fce4283f8f28da957f9e82ec121efbc6ee55241 --- firmware/App/Modes/ModeTreatment.c (.../ModeTreatment.c) (revision f6888c7e4e05cb84b11fceb4340458d8af543ce8) +++ firmware/App/Modes/ModeTreatment.c (.../ModeTreatment.c) (revision 0fce4283f8f28da957f9e82ec121efbc6ee55241) @@ -139,6 +139,12 @@ // initialize treatment sub-modes each time we transition to treatment mode initDialysis(); initTreatmentStop(); + + // set user alarm recovery actions allowed in this mode + setAlarmUserActionEnabled( ALARM_USER_ACTION_RESUME, TRUE ); + setAlarmUserActionEnabled( ALARM_USER_ACTION_RINSEBACK, TRUE ); + setAlarmUserActionEnabled( ALARM_USER_ACTION_END_TREATMENT, TRUE ); + #ifdef RM46_EVAL_BOARD_TARGET // TODO - temporary test code for eval board start = getMSTimerCount(); Index: firmware/App/Modes/ModeTreatmentParams.c =================================================================== diff -u -rf6888c7e4e05cb84b11fceb4340458d8af543ce8 -r0fce4283f8f28da957f9e82ec121efbc6ee55241 --- firmware/App/Modes/ModeTreatmentParams.c (.../ModeTreatmentParams.c) (revision f6888c7e4e05cb84b11fceb4340458d8af543ce8) +++ firmware/App/Modes/ModeTreatmentParams.c (.../ModeTreatmentParams.c) (revision 0fce4283f8f28da957f9e82ec121efbc6ee55241) @@ -130,6 +130,11 @@ treatParamsRejected = FALSE; treatmentCancelled = FALSE; + // set user alarm recovery actions allowed in this mode + setAlarmUserActionEnabled( ALARM_USER_ACTION_RESUME, TRUE ); + setAlarmUserActionEnabled( ALARM_USER_ACTION_RINSEBACK, FALSE ); + setAlarmUserActionEnabled( ALARM_USER_ACTION_END_TREATMENT, FALSE ); + // temporary test code. TODO - remove later #ifdef RM46_EVAL_BOARD_TARGET start = getMSTimerCount(); 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 Index: firmware/App/Services/AlarmMgmt.h =================================================================== diff -u -rf6888c7e4e05cb84b11fceb4340458d8af543ce8 -r0fce4283f8f28da957f9e82ec121efbc6ee55241 --- firmware/App/Services/AlarmMgmt.h (.../AlarmMgmt.h) (revision f6888c7e4e05cb84b11fceb4340458d8af543ce8) +++ firmware/App/Services/AlarmMgmt.h (.../AlarmMgmt.h) (revision 0fce4283f8f28da957f9e82ec121efbc6ee55241) @@ -189,12 +189,12 @@ SW_FAULT_ID_RTC_TRANSACTION_SERVICE_INVALID_STATE, SW_FAULT_ID_PRES_OCCL_INVALID_STATE, SW_FAULT_ID_OP_MODES_INVALID_MODE_TO_SIGNAL_ACTION, - SW_FAULT_ID____AVAILABLE_1, + SW_FAULT_ID_ALARM_MGMT_INVALID_USER_ACTION, SW_FAULT_ID_MSG_PENDING_ACK_LIST_FULL, // 50 SW_FAULT_ID_PI_CTRL_INVALID_CONTROLLER, SW_FAULT_ID_PI_CTRL_INVALID_SIGNAL, + SW_FAULT_ID____AVAILABLE_1, SW_FAULT_ID____AVAILABLE_2, - SW_FAULT_ID____AVAILABLE_3, SW_FAULT_ID_DIALYSIS_INVALID_STATE, // 55 SW_FAULT_ID_DIALYSIS_INVALID_UF_STATE, SW_FAULT_ID_NVDATAMGMT_INVALID_SELF_TEST_STATE, @@ -244,7 +244,8 @@ void activateAlarm1Data( ALARM_ID_T alarm, ALARM_DATA_T alarmData ); void activateAlarm2Data( ALARM_ID_T alarm, ALARM_DATA_T alarmData1, ALARM_DATA_T alarmData2 ); void clearAlarm( ALARM_ID_T alarm ); -void clearAlarmCondition( ALARM_ID_T alarm ); +void clearAlarmCondition( ALARM_ID_T alarm ); +void setAlarmUserActionEnabled( ALARM_USER_ACTION_T action, BOOL enabled ); void signalAlarmUserActionInitiated( ALARM_USER_ACTION_T action ); BOOL isAlarmActive( ALARM_ID_T alarm ); ALARM_PRIORITY_T getCurrentAlarmStatePriority( void );