Index: firmware/App/Modes/StatePreTxRecirculate.c =================================================================== diff -u -r87d4b0145a1f6a2ccf38e006e30dbf5dd854ed7e -r03e019a69e1d0e45a95b77711270a3b1781e693d --- firmware/App/Modes/StatePreTxRecirculate.c (.../StatePreTxRecirculate.c) (revision 87d4b0145a1f6a2ccf38e006e30dbf5dd854ed7e) +++ firmware/App/Modes/StatePreTxRecirculate.c (.../StatePreTxRecirculate.c) (revision 03e019a69e1d0e45a95b77711270a3b1781e693d) @@ -38,10 +38,10 @@ // ********** private definitions ********** #define PRE_TX_RECIRC_BLOOD_FLOW_RATE_ML_MIN 100 ///< Blood pump flow rate during recirculation in mL/min. -#define PRE_TX_RECIRC_DIALYSATE_FLOW_RATE_ML_MIN 250 ///< Dialysate flow rate during recirculation in mL/min. -#define RECIRC_MEDIUM_TIME_MS ( 90 * SEC_PER_MIN * MS_PER_SECOND ) ///< Pre-Treatment recirc time before medium priority warning in min. -#define RECIRC_HIGH_TIME_MS ( 120 * SEC_PER_MIN * MS_PER_SECOND ) ///< Pre-Treatment recirc time before high priority alarm in min. +#define PRE_TX_RECIRC_DIALYSATE_FLOW_RATE_ML_MIN 400 ///< Dialysate flow rate during recirculation in mL/min. +#define RECIRC_MEDIUM_TIME_MS ( 90 * SEC_PER_MIN * MS_PER_SECOND ) ///< Pre-Treatment recirc time before medium priority warning in milliseconds.. +/// Enumeration of Pre-Treatment Recirculation sub-states. typedef enum PreTxRecirculate_States { PRE_TX_RECIRCULATE_STATE = 0, @@ -56,7 +56,6 @@ static U32 preTxRecircStartTime; ///< Recirculation start time (ms timer count). static BOOL recircMediumAlarmGiven; ///< Flag indicating medium recirculation alarm has been raised. -static BOOL recircHighAlarmGiven; ///< Flag indicating high recirculation alarm has been raised. // ********** private function prototypes ********** @@ -73,7 +72,7 @@ * @details \b Inputs: none. * @details \b Outputs: currentPreTxRecircState, * recircResumeRequested, preTxRecircStartTime, - * recircMediumAlarmGiven, recircHighAlarmGiven. + * recircMediumAlarmGiven. * @return none. *************************************************************************/ void initPreTxRecirculate( void ) @@ -82,14 +81,13 @@ recircResumeRequested = FALSE; preTxRecircStartTime = getMSTimerCount(); recircMediumAlarmGiven = FALSE; - recircHighAlarmGiven = FALSE; } /*********************************************************************//** * @brief * The transitionToPreTxRecirculate function transitions the software * into pre-treatment recirculation. - * @details \b Inputs: none. + * @details \b Inputs: currentPreTxRecircState . * @details \b Outputs: currentPreTxRecircState. * @return none *************************************************************************/ @@ -104,26 +102,19 @@ * @brief * The execPreTxRecirculate function executes the Pre-Treatment * Recirculate state machine. + * @details \b Alarm: ALARM_ID_TD_SOFTWARE_FAULT if the current + * recirculation sub-state is invalid. * @details \b Inputs: currentPreTxRecircState, * preTxRecircStartTime, recircMediumAlarmGiven, - * recircHighAlarmGiven, recircResumeRequested. - * @details \b Outputs: currentPreTxRecircState, - * recircMediumAlarmGiven, recircHighAlarmGiven, * recircResumeRequested. - * @return none + * @details \b Outputs: currentPreTxRecircState, + * recircMediumAlarmGiven, recircResumeRequested. + * @return none. *************************************************************************/ void execPreTxRecirculate( void ) { PRE_TX_RECIRCULATE_STATE_T priorSubState = currentPreTxRecircState; - if ( ( FALSE == recircHighAlarmGiven ) && - ( TRUE == didTimeout( preTxRecircStartTime, RECIRC_HIGH_TIME_MS ) ) ) - { - recircHighAlarmGiven = TRUE; - clearAlarm( ALARM_ID_TD_PRIME_COMPLETED_MEDIUM ); - activateAlarmNoData( ALARM_ID_TD_PRIME_COMPLETED_HIGH ); - } - switch ( currentPreTxRecircState ) { case PRE_TX_RECIRCULATE_STATE: @@ -190,10 +181,12 @@ * @brief * The handlePreTxRecirculateState function handles the * Recirculate sub-state. + * @details \b Alarm: ALARM_ID_TD_PRIME_COMPLETED_MEDIUM if the + * recirculation timeout expires. * @details \b Inputs: preTxRecircStartTime, - * recircMediumAlarmGiven - * @details \b Outputs: recircMediumAlarmGiven - * @return next Recirculate sub-state + * recircMediumAlarmGiven. + * @details \b Outputs: recircMediumAlarmGiven. + * @return next Recirculate sub-state. *************************************************************************/ static PRE_TX_RECIRCULATE_STATE_T handlePreTxRecirculateState( void ) {