Index: firmware/App/Modes/TreatmentStop.c =================================================================== diff -u -r04334ed8d1e927939718b1d62fb01afef0a2b9a9 -r8e7158d8231435496fcf1d5649e51babf859ccc7 --- firmware/App/Modes/TreatmentStop.c (.../TreatmentStop.c) (revision 04334ed8d1e927939718b1d62fb01afef0a2b9a9) +++ firmware/App/Modes/TreatmentStop.c (.../TreatmentStop.c) (revision 8e7158d8231435496fcf1d5649e51babf859ccc7) @@ -1,23 +1,26 @@ -/**********************************************************************//** - * - * Copyright (c) 2020 Diality Inc. - All Rights Reserved. - * - * 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 TreatmentStop.c - * - * @date 15-Jan-2020 - * @author S. Nash - * - * @brief State machine for the treatment stop sub-mode of treatment mode. - * - **************************************************************************/ +/************************************************************************** +* +* Copyright (c) 2019-2021 Diality Inc. - All Rights Reserved. +* +* 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 TreatmentStop.c +* +* @author (last) Sean Nash +* @date (last) 13-Nov-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 @@ -29,38 +32,44 @@ // ********** private function prototypes ********** /*********************************************************************//** - * @brief initTreatmentStop + * @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 ) { } /*********************************************************************//** - * @brief transitionToTreatmentStop - * The transitionToTreatmentStop function prepares for transition to treatment \n + * @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 execTreatmentStop - * The execTreatmentStop function executes the Treatment Stop sub-mode \n + * @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 )