Index: firmware/App/Modes/TreatmentStop.c =================================================================== diff -u -rd91a24c730aeb5cd7e3eba9ef4eca78e442911f8 -r1a685471524555a374854c0c9ec8e208e71fe2df --- firmware/App/Modes/TreatmentStop.c (.../TreatmentStop.c) (revision d91a24c730aeb5cd7e3eba9ef4eca78e442911f8) +++ firmware/App/Modes/TreatmentStop.c (.../TreatmentStop.c) (revision 1a685471524555a374854c0c9ec8e208e71fe2df) @@ -8,17 +8,19 @@ * @file TreatmentStop.c * * @author (last) Sean Nash -* @date (last) 24-Aug-2020 +* @date (last) 24-Sep-2020 * * @author (original) Sean * @date (original) 15-Jan-2020 * ***************************************************************************/ +#include "AirTrap.h" #include "Buttons.h" #include "ModeTreatment.h" #include "OperationModes.h" #include "TreatmentStop.h" +#include "Valves.h" /** * @addtogroup TreatmentStop @@ -33,9 +35,8 @@ * @brief * The initTreatmentStop function initializes the Treatment Stop sub-mode * module. - * @details - * Inputs : none - * Outputs : Treatment Stop sub-mode module initialized. + * @details Inputs: none + * @details Outputs: Treatment Stop sub-mode module initialized. * @return none *************************************************************************/ void initTreatmentStop( void ) @@ -46,22 +47,29 @@ * @brief * The transitionToTreatmentStop function prepares for transition to treatment * stop sub-mode. - * @details - * Inputs : none - * Outputs : none + * @details Inputs: none + * @details Outputs: none * @return none *************************************************************************/ void transitionToTreatmentStop( void ) { + // set valves to safe state + setValvePosition( VDI, VALVE_POSITION_C_CLOSE ); + setValvePosition( VDO, VALVE_POSITION_C_CLOSE ); + setValvePosition( VBA, VALVE_POSITION_C_CLOSE ); + setValvePosition( VBV, VALVE_POSITION_C_CLOSE ); + // reset saline bolus state in case alarm interrupted one + resetSalineBolus(); + // stop air trap control + endAirTrapControl(); } /*********************************************************************//** * @brief * The execTreatmentStop function executes the Treatment Stop sub-mode * state machine. - * @details - * Inputs : none - * Outputs : none + * @details Inputs: none + * @details Outputs: none * @return none *************************************************************************/ void execTreatmentStop( void )