Index: firmware/App/Modes/TreatmentRecirc.c =================================================================== diff -u -rc539499ea2dee6d62194d573ac93b313d9e2936d -rfa356a2bce909141f45c6832659fa1ceea5bfbba --- firmware/App/Modes/TreatmentRecirc.c (.../TreatmentRecirc.c) (revision c539499ea2dee6d62194d573ac93b313d9e2936d) +++ firmware/App/Modes/TreatmentRecirc.c (.../TreatmentRecirc.c) (revision fa356a2bce909141f45c6832659fa1ceea5bfbba) @@ -16,7 +16,11 @@ ***************************************************************************/ #include "AirTrap.h" +#include "BloodFlow.h" #include "Buttons.h" +#include "DGInterface.h" +#include "DialInFlow.h" +#include "DialOutFlow.h" #include "ModeTreatment.h" #include "OperationModes.h" #include "TreatmentRecirc.h" @@ -33,6 +37,9 @@ // ********** private function prototypes ********** +static TREATMENT_RECIRC_STATE_T handleRecircRecircState( void ); +static TREATMENT_RECIRC_STATE_T handleRecircStoppedState( void ); + /*********************************************************************//** * @brief * The initTreatmentRecirc function initializes the Treatment Re-circulate sub-mode @@ -69,6 +76,11 @@ endAirTrapControl(); // Should always have stopped alarm active in treatment stop sub-mode so that user can take action activateAlarmNoData( ALARM_ID_TREATMENT_STOPPED_BY_USER ); + + // Set user alarm recovery actions allowed in this sub-mode + setAlarmUserActionEnabled( ALARM_USER_ACTION_RESUME, FALSE ); + setAlarmUserActionEnabled( ALARM_USER_ACTION_RINSEBACK, FALSE ); + setAlarmUserActionEnabled( ALARM_USER_ACTION_END_TREATMENT, FALSE ); } /*********************************************************************//** @@ -81,7 +93,60 @@ *************************************************************************/ void execTreatmentRecirc( void ) { - // TODO - implement + switch ( treatmentRecircState ) + { + case TREATMENT_RECIRC_RECIRC_STATE: + treatmentRecircState = handleRecircRecircState(); + break; + + case TREATMENT_RECIRC_STOPPED_STATE: + treatmentRecircState = handleRecircStoppedState(); + break; + + default: + // TODO - s/w fault + break; + } } +static TREATMENT_RECIRC_STATE_T handleRecircRecircState( void ) +{ + TREATMENT_RECIRC_STATE_T result = TREATMENT_RECIRC_RECIRC_STATE; + + return result; +} + +static TREATMENT_RECIRC_STATE_T handleRecircStoppedState( void ) +{ + TREATMENT_RECIRC_STATE_T result = TREATMENT_RECIRC_STOPPED_STATE; + + return result; +} + +/*********************************************************************//** + * @brief + * The signalStopTreatmentRecirc function signals the treatment re-circulate + * sub-mode to stop per an active alarm. + * @details Inputs: none + * @details Outputs: none + * @return none + *************************************************************************/ +void signalStopTreatmentRecirc( void ) +{ + +} + +/*********************************************************************//** + * @brief + * The getCurrentTreatmentRecircState function returns the current state of the + * treatment re-circulate sub-mode. + * @details Inputs: treatmentRecircState + * @details Outputs: none + * @return treatmentRecircState + *************************************************************************/ +TREATMENT_RECIRC_STATE_T getCurrentTreatmentRecircState( void ) +{ + return treatmentRecircState; +} + /**@}*/