Index: firmware/App/Modes/TreatmentEnd.c =================================================================== diff -u -r44a100f8e5210a02c23b8fcc4527d8e96d577381 -rccfd15568f1e3d304320c2babb2fd4bcf0413304 --- firmware/App/Modes/TreatmentEnd.c (.../TreatmentEnd.c) (revision 44a100f8e5210a02c23b8fcc4527d8e96d577381) +++ firmware/App/Modes/TreatmentEnd.c (.../TreatmentEnd.c) (revision ccfd15568f1e3d304320c2babb2fd4bcf0413304) @@ -5,13 +5,13 @@ * THIS CODE MAY NOT BE COPIED OR REPRODUCED IN ANY FORM, IN PART OR IN * WHOLE, WITHOUT THE EXPLICIT PERMISSION OF THE COPYRIGHT OWNER. * -* @file TreatmentEnd.c +* @file TreatmentEnd.c * -* @author (last) Sean Nash -* @date (last) 04-Feb-2021 +* @author (last) Sean Nash +* @date (last) 19-Aug-2021 * -* @author (original) Sean -* @date (original) 04-Feb-2021 +* @author (original) Sean Nash +* @date (original) 05-Feb-2021 * ***************************************************************************/ @@ -39,8 +39,10 @@ /// Max time to wait for user to initiate final rinseback. static const U32 TX_END_TIMEOUT_MS = ( ( 15 * 60 * MS_PER_SECOND ) / TASK_GENERAL_INTERVAL ); // TODO - get time from Systems -/// Maximum time in this mode before blood sitting warning given (in general task intervals). +/// Maximum time in this mode before blood sitting alarm given (in general task intervals). static const U32 MAX_TIME_BLOOD_SITTING = ( ( 5 * SEC_PER_MIN * MS_PER_SECOND ) / TASK_GENERAL_INTERVAL ); +/// Maximum time in this mode before blood sitting warning given (in general task intervals). +static const U32 WARN_TIME_BLOOD_SITTING = ( ( 4 * SEC_PER_MIN * MS_PER_SECOND ) / TASK_GENERAL_INTERVAL ); // ********** private data ********** @@ -275,8 +277,13 @@ else { // Ensure we do not sit in stopped state for too long + if ( bloodSittingTimerCtr > WARN_TIME_BLOOD_SITTING ) + { + activateAlarmNoData( ALARM_ID_BLOOD_SITTING_WARNING ); + } if ( bloodSittingTimerCtr > MAX_TIME_BLOOD_SITTING ) { + // Raise the alarm activateAlarmNoData( ALARM_ID_TREATMENT_STOPPED_NO_RINSEBACK ); } }