Index: firmware/App/Services/AlarmMgmt.c =================================================================== diff -u -rb8d74fc5b07d0e62d841b4c5a786b2be4e593c63 -r565ed0856be2fcf1443e3ec4cb8fe023b2c14db4 --- firmware/App/Services/AlarmMgmt.c (.../AlarmMgmt.c) (revision b8d74fc5b07d0e62d841b4c5a786b2be4e593c63) +++ firmware/App/Services/AlarmMgmt.c (.../AlarmMgmt.c) (revision 565ed0856be2fcf1443e3ec4cb8fe023b2c14db4) @@ -34,10 +34,9 @@ // ********** private definitions ********** /// Interval to control lamp and audio and to publish alarm status data. -#define ALARM_STATUS_PUBLISH_INTERVAL ( ALARM_LAMP_AND_AUDIO_CONTROL_INTERVAL_MS / TASK_GENERAL_INTERVAL ) +static const U32 ALARM_STATUS_PUBLISH_INTERVAL = ( ALARM_LAMP_AND_AUDIO_CONTROL_INTERVAL_MS / TASK_GENERAL_INTERVAL ); #define ALARM_SILENCE_EXPIRES_IN_SECS (60) ///< Alarm silence expiration time in seconds. -#define ALARM_SILENCE_REQUESTED 1 ///< User cmd to request alarm silence (1=silence, 0=cancel silence). #define SUPERVISOR_ALARM_KEY 0xD2C3B4A5 ///< 32-bit key required for clear all alarms request. @@ -148,7 +147,8 @@ alarmStatus.noResume = FALSE; alarmStatus.noRinseback = FALSE; alarmStatus.noEndTreatment = FALSE; - alarmStatus.noNewTreatment = FALSE; + alarmStatus.noNewTreatment = FALSE; + alarmStatus.noDialRecirc = FALSE; alarmStatus.usrACKRequired = FALSE; } @@ -193,7 +193,12 @@ { // No need to do anything if alarm is already active if ( FALSE == alarmIsActive[ alarm ] ) - { + { + // If alarm status was that no alarms currently active, set this alarm as top alarm until status formally updated later + if ( ALARM_ID_NO_ALARM == alarmStatus.alarmTop ) + { + alarmStatus.alarmTop = alarm; + } // If alarms silenced, end silence due to new alarm alarmStatus.alarmsSilenced = FALSE; // If alarm is a fault, request transition to fault mode @@ -428,9 +433,9 @@ * @param cmd ID of user command (1=silence, 0=cancel silence) * @return none *************************************************************************/ -void signalAlarmSilence( U32 cmd ) +void signalAlarmSilence( ALARM_SILENCE_CMD_T cmd ) { - if ( ALARM_SILENCE_REQUESTED == cmd ) + if ( ALARM_SILENCE_CMD_START == cmd ) { if ( FALSE == alarmStatus.alarmsSilenced ) { @@ -543,6 +548,19 @@ /*********************************************************************//** * @brief + * The isDialysateRecircBlocked function determines whether any currently + * active alarm is blocking dialysate re-circulation. + * @details Inputs: alarmStatus + * @details Outputs: none + * @return TRUE if any active alarm prevents dialysate re-circulation, FALSE if not + *************************************************************************/ +BOOL isDialysateRecircBlocked( void ) +{ + return alarmStatus.noDialRecirc; +} + +/*********************************************************************//** + * @brief * The doesAlarmStatusIndicateStop function determines whether any currently * active alarm has stop property. * @details Inputs: alarmStatus @@ -642,7 +660,8 @@ { ALARM_PRIORITY_T highestPriority = ALARM_PRIORITY_NONE; ALARM_ID_T a; - BOOL faultsActive = FALSE; + BOOL faultsActive = FALSE; + BOOL dialysateRecircBlocked = FALSE; // Update FIFOs and sub-ranks per active alarms table - for alarm ranking purposes to determine "top" alarm for ( a = ALARM_ID_NO_ALARM; a < NUM_OF_ALARM_IDS; a++ ) @@ -680,14 +699,20 @@ if ( TRUE == ALARM_TABLE[ a ].alarmIsFault ) { faultsActive = TRUE; + } + // Track whether any active alarms prevent dialysate re-circulation so far + if ( TRUE == ALARM_TABLE[ a ].alarmNoDialysateRecirc ) + { + dialysateRecircBlocked = TRUE; } } } // Update alarm to display per highest priority FIFO alarmStatus.alarmsState = highestPriority; alarmStatus.alarmTop = alarmPriorityFIFO[ highestPriority ].alarmID; - alarmStatus.systemFault = faultsActive; + alarmStatus.systemFault = faultsActive; + alarmStatus.noDialRecirc = dialysateRecircBlocked; } /*********************************************************************//**