Index: firmware/App/Modes/ModeService.c =================================================================== diff -u -r4bae2d153f4242a52c8602df3e5161d6f1f122ef -rcd5be724d5a3ba7457e761191d82f278654d7f5c --- firmware/App/Modes/ModeService.c (.../ModeService.c) (revision 4bae2d153f4242a52c8602df3e5161d6f1f122ef) +++ firmware/App/Modes/ModeService.c (.../ModeService.c) (revision cd5be724d5a3ba7457e761191d82f278654d7f5c) @@ -1,26 +1,28 @@ /************************************************************************** * -* Copyright (c) 2019-2023 Diality Inc. - All Rights Reserved. +* Copyright (c) 2019-2024 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 ModeService.c * -* @author (last) Sean Nash -* @date (last) 13-Jul-2022 +* @author (last) Dara Navaei +* @date (last) 17-Oct-2023 * * @author (original) Dara Navaei * @date (original) 05-Nov-2019 * ***************************************************************************/ +#include "AirPump.h" #include "BloodFlow.h" #include "Buttons.h" #include "DGInterface.h" #include "DialInFlow.h" #include "DialOutFlow.h" #include "ModeService.h" +#include "NVDataMgmt.h" #include "OperationModes.h" #include "Switches.h" #include "SyringePump.h" @@ -55,26 +57,30 @@ *************************************************************************/ U32 transitionToServiceMode( void ) { + initServiceMode(); + doorClosedRequired( FALSE, FALSE ); syringeDetectionRequired( FALSE ); + setCurrentSubState( NO_SUB_STATE ); // Set user alarm recovery actions allowed in this mode setAlarmUserActionEnabled( ALARM_USER_ACTION_RESUME, FALSE ); setAlarmUserActionEnabled( ALARM_USER_ACTION_RINSEBACK, FALSE ); setAlarmUserActionEnabled( ALARM_USER_ACTION_END_TREATMENT, FALSE ); - // Start out with all actuators de-energized in service mode + // Start out with all actuators off in service mode (exception for valves which will be in insert position to allow cartridge insert) cmdStopDGTrimmerHeater(); stopSyringePump(); signalBloodPumpHardStop(); signalDialInPumpHardStop(); signalDialOutPumpHardStop(); - // TODO - turn off air pump + setAirPumpState( AIR_PUMP_STATE_OFF ); + setValveAirTrap( STATE_CLOSED ); - setValvePosition( VDI, VALVE_POSITION_C_CLOSE ); - setValvePosition( VDO, VALVE_POSITION_C_CLOSE ); - setValvePosition( VBA, VALVE_POSITION_C_CLOSE ); - setValvePosition( VBV, VALVE_POSITION_C_CLOSE ); + setValvePosition( VDI, VALVE_POSITION_A_INSERT_EJECT ); + setValvePosition( VDO, VALVE_POSITION_A_INSERT_EJECT ); + setValvePosition( VBA, VALVE_POSITION_A_INSERT_EJECT ); + setValvePosition( VBV, VALVE_POSITION_A_INSERT_EJECT ); return 0; }