Index: firmware/App/Modes/TreatmentEnd.c =================================================================== diff -u -r4f3b9e168915ab13dfcdc74462d7142115cc2d57 -r3833c8a7a90288a6010a625a884048c775c598d3 --- firmware/App/Modes/TreatmentEnd.c (.../TreatmentEnd.c) (revision 4f3b9e168915ab13dfcdc74462d7142115cc2d57) +++ firmware/App/Modes/TreatmentEnd.c (.../TreatmentEnd.c) (revision 3833c8a7a90288a6010a625a884048c775c598d3) @@ -311,16 +311,19 @@ } else { - // Ensure we do not sit in stopped state for too long - if ( bloodSittingTimerCtr > WARN_TIME_BLOOD_SITTING ) + if ( FALSE == doesAlarmStatusIndicateEndTxOnly() ) // Alarms appropriate only if we are not already at an alarm stop, end Tx only { - activateAlarmNoData( ALARM_ID_HD_END_OF_TREATMENT_ALARM ); + // Ensure we do not sit in stopped state for too long + if ( bloodSittingTimerCtr > WARN_TIME_BLOOD_SITTING ) + { + activateAlarmNoData( ALARM_ID_HD_END_OF_TREATMENT_ALARM ); + } + if ( bloodSittingTimerCtr > MAX_TIME_BLOOD_SITTING ) + { + // Raise the alarm + activateAlarmNoData( ALARM_ID_HD_END_OF_TREATMENT_HIGH ); + } } - if ( bloodSittingTimerCtr > MAX_TIME_BLOOD_SITTING ) - { - // Raise the alarm - activateAlarmNoData( ALARM_ID_HD_END_OF_TREATMENT_HIGH ); - } } return result; Index: firmware/App/Modes/TreatmentStop.c =================================================================== diff -u -r61329f4338e01017c1b31d063a17a187ec12c37d -r3833c8a7a90288a6010a625a884048c775c598d3 --- firmware/App/Modes/TreatmentStop.c (.../TreatmentStop.c) (revision 61329f4338e01017c1b31d063a17a187ec12c37d) +++ firmware/App/Modes/TreatmentStop.c (.../TreatmentStop.c) (revision 3833c8a7a90288a6010a625a884048c775c598d3) @@ -405,15 +405,19 @@ // Ensure we do not sit in stopped state for too long (if blood in line) if ( getRinsebackCompleted() != TRUE ) { - if ( ++bloodSittingTimerCtr > WARN_TIME_BLOOD_SITTING ) + bloodSittingTimerCtr++; + if ( FALSE == doesAlarmStatusIndicateEndTxOnly() ) // Alarms appropriate only if we are not already at an alarm stop, end Tx only { - activateAlarmNoData( ALARM_ID_HD_BLOOD_SITTING_WARNING ); + if ( bloodSittingTimerCtr > WARN_TIME_BLOOD_SITTING ) + { + activateAlarmNoData( ALARM_ID_HD_BLOOD_SITTING_WARNING ); + } + if ( bloodSittingTimerCtr > MAX_TIME_BLOOD_SITTING ) + { + // Activate the alarm + activateAlarmNoData( ALARM_ID_HD_TREATMENT_STOPPED_NO_RINSEBACK ); + } } - if ( bloodSittingTimerCtr > MAX_TIME_BLOOD_SITTING ) - { - // Activate the alarm - activateAlarmNoData( ALARM_ID_HD_TREATMENT_STOPPED_NO_RINSEBACK ); - } } else { Index: firmware/App/Services/AlarmMgmt.c =================================================================== diff -u -r6638c6167a7f771fbbccaedebed5023643523f94 -r3833c8a7a90288a6010a625a884048c775c598d3 --- firmware/App/Services/AlarmMgmt.c (.../AlarmMgmt.c) (revision 6638c6167a7f771fbbccaedebed5023643523f94) +++ firmware/App/Services/AlarmMgmt.c (.../AlarmMgmt.c) (revision 3833c8a7a90288a6010a625a884048c775c598d3) @@ -711,6 +711,20 @@ /*********************************************************************//** * @brief + * The doesAlarmStatusIndicateEndTxOnly function determines whether any currently + * active alarm has ( stop && noRes && /noET ) property, that is end treatment is + * the only choice from full stop. + * @details Inputs: alarmStatus + * @details Outputs: none + * @return TRUE if any active alarm has stop property, FALSE if not + *************************************************************************/ +BOOL doesAlarmStatusIndicateEndTxOnly( void ) +{ + return ( ( ( TRUE == alarmStatus.stop ) && ( TRUE == alarmStatus.noResume ) && ( FALSE == alarmStatus.noEndTreatment ) ) ? TRUE : FALSE ); +} + +/*********************************************************************//** + * @brief * The doesAlarmStatusIndicateStop function determines whether any currently * active alarm has stop property. * @details Inputs: alarmStatus Index: firmware/App/Services/AlarmMgmt.h =================================================================== diff -u -r4e9b962e7cb3c0b477462756a32214118b10fc16 -r3833c8a7a90288a6010a625a884048c775c598d3 --- firmware/App/Services/AlarmMgmt.h (.../AlarmMgmt.h) (revision 4e9b962e7cb3c0b477462756a32214118b10fc16) +++ firmware/App/Services/AlarmMgmt.h (.../AlarmMgmt.h) (revision 3833c8a7a90288a6010a625a884048c775c598d3) @@ -211,6 +211,7 @@ BOOL isDialysateRecircBlocked( void ); BOOL doesAlarmStatusIndicateStop( void ); BOOL doesAlarmIndicateNoResume( void ); +BOOL doesAlarmStatusIndicateEndTxOnly( void ); ALARM_PRIORITY_T getCurrentAlarmStatePriority( void ); BOOL isAlarmRecoverable( ALARM_ID_T alarm ); void setAlarmAudioVolume( U32 volumeLevel );