/************************************************************************** * * Copyright (c) 2024-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 * @date (last) 30-Jul-2024 * * @author (original) Sean * @date (original) 30-Jul-2024 * ***************************************************************************/ #include "TDCommon.h" //#include "AirPump.h" //#include "BloodFlow.h" //#include "Buttons.h" //#include "DDInterface.h" #include "ModeService.h" //#include "NVDataMgmt.h" #include "OperationModes.h" //#include "Switches.h" //#include "Valves.h" /** * @addtogroup TDServiceMode * @{ */ // ********** private data ********** // ********** private function prototypes ********** /*********************************************************************//** * @brief * The initServiceMode function initializes the Service Mode unit. * @details \b Inputs: none * @details \b Outputs: Service Mode unit initialized. * @return none *************************************************************************/ void initServiceMode( void ) { } /*********************************************************************//** * @brief * The transitionToServiceMode function prepares for transition to service mode. * @details \b Inputs: none * @details \b Outputs: none * @return initial state *************************************************************************/ 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 off in service mode (exception for valves which will be in insert position to allow cartridge insert) // stopSyringePump(); // signalBloodPumpHardStop(); // setAirPumpState( AIR_PUMP_STATE_OFF ); // setValveAirTrap( STATE_CLOSED ); // setValvePosition( H1_VALV, VALVE_POSITION_A_INSERT_EJECT ); // setValvePosition( H19, VALVE_POSITION_A_INSERT_EJECT ); return 0; } /*********************************************************************//** * @brief * The execServiceMode function executes the Service Mode state machine. * @details \b Inputs: none * @details \b Outputs: none * @return current state (sub-mode) *************************************************************************/ U32 execServiceMode( void ) { // BOOL stop = isStopButtonPressed(); // // if ( TRUE == stop ) // { // // Ignore stop button in this mode. // } return 0; // TODO - return current state } /*********************************************************************//** * @brief * The signalAlarmActionToServiceMode function executes the given alarm action * as appropriate while in Service Mode. * @details \b Inputs: none * @details \b Outputs: given alarm action executed * @param action ID of alarm action to execute * @return none *************************************************************************/ void signalAlarmActionToServiceMode( ALARM_ACTION_T action ) { // TODO - implement } /**@}*/