/************************************************************************** * * Copyright (c) 2019-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 Rinseback.c * * @author (last) Sean Nash * @date (last) 14-Jan-2021 * * @author (original) Sean * @date (original) 14-Jan-2021 * ***************************************************************************/ #include "AirTrap.h" #include "Buttons.h" #include "ModeTreatment.h" #include "OperationModes.h" #include "Rinseback.h" #include "Valves.h" /** * @addtogroup Rinseback * @{ */ // ********** private data ********** static RINSEBACK_STATE_T rinsebackState; ///< Current state of the rinseback sub-mode. // ********** private function prototypes ********** /*********************************************************************//** * @brief * The initRinseback function initializes the Rinseback sub-mode module. * @details Inputs: none * @details Outputs: Rinseback sub-mode module initialized. * @return none *************************************************************************/ void initRinseback( void ) { rinsebackState = RINSEBACK_STOP_INIT_STATE; } /*********************************************************************//** * @brief * The transitionToRinseback function prepares for transition to Rinseback * sub-mode. * @details Inputs: none * @details Outputs: none * @return none *************************************************************************/ void transitionToRinseback( void ) { initRinseback(); // 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(); // Should always have stopped alarm active in treatment stop sub-mode so that user can take action activateAlarmNoData( ALARM_ID_TREATMENT_STOPPED_BY_USER ); } /*********************************************************************//** * @brief * The execRinseback function executes the Rinseback sub-mode state machine. * @details Inputs: none * @details Outputs: none * @return none *************************************************************************/ void execRinseback( void ) { // TODO - implement } /**@}*/