Index: firmware/App/Modes/TreatmentRecirc.c =================================================================== diff -u -rc021768acf8408116a87585e21c2237713d6c825 -r685e17a553a4fdf7dd8b3715e95d151eeff3c866 --- firmware/App/Modes/TreatmentRecirc.c (.../TreatmentRecirc.c) (revision c021768acf8408116a87585e21c2237713d6c825) +++ firmware/App/Modes/TreatmentRecirc.c (.../TreatmentRecirc.c) (revision 685e17a553a4fdf7dd8b3715e95d151eeff3c866) @@ -34,8 +34,10 @@ // ********** private definitions ********** -/// Alarm if re-circulation is running for this much time. TODO - finalize these times w/ Systems +/// Maximum time allowed to be in recirculation sub-mode. static const U32 RECIRC_TIMEOUT = ( ( 15 * SEC_PER_MIN * MS_PER_SECOND ) / TASK_GENERAL_INTERVAL ); +/// Warn user they need to reconnect to system and resume their treatment soon. +static const U32 RECIRC_WARNING_TIMEOUT = ( ( 10 * SEC_PER_MIN * MS_PER_SECOND ) / TASK_GENERAL_INTERVAL ); /// Re-circulation status broadcast interval. static const U32 RECIRC_DATA_PUBLISH_INTERVAL = ( MS_PER_SECOND / TASK_GENERAL_INTERVAL ); /// Target flow rate for re-circulation of saline on blood-side circuit. @@ -47,6 +49,7 @@ static U32 recircTimerCtr; ///< Timer counter (in GP task intervals) counts time spent in re-circulation sub-mode. static U32 recircPublishTimerCtr; ///< Timer counter (in GP task intervals) counts time to next status broadcast. +static BOOL recircTimeoutWarningGiven; ///< Flag indicates 10 minute warning has been given to user. static BOOL recircReconnectRequested; ///< Flag indicates user requesting re-circulate stop so they can re-connect. static BOOL recircBackToTreatmenRequested; ///< Flag indicates user requesting to go back to treatment (confirming re-connected). @@ -84,6 +87,7 @@ recircTimerCtr = 0; recircPublishTimerCtr = 0; resetTreatmentRecircFlags(); + recircTimeoutWarningGiven = FALSE; } /*********************************************************************//** @@ -238,6 +242,11 @@ signalGoToTreatmentStopped(); activateAlarmNoData( ALARM_ID_TREATMENT_RECIRC_TIMEOUT_ALARM ); } + else if ( ( recircTimeoutWarningGiven != TRUE ) && ( recircTimerCtr > RECIRC_WARNING_TIMEOUT ) ) + { + recircTimeoutWarningGiven = TRUE; + activateAlarmNoData( ALARM_ID_HD_TREATMENT_RECIRC_TIMEOUT_WARNING ); + } return result; } @@ -276,6 +285,11 @@ signalGoToTreatmentStopped(); activateAlarmNoData( ALARM_ID_TREATMENT_RECIRC_TIMEOUT_ALARM ); } + else if ( ( recircTimeoutWarningGiven != TRUE ) && ( recircTimerCtr > RECIRC_WARNING_TIMEOUT ) ) + { + recircTimeoutWarningGiven = TRUE; + activateAlarmNoData( ALARM_ID_HD_TREATMENT_RECIRC_TIMEOUT_WARNING ); + } return result; }