Index: firmware/App/Modes/ModeStandby.c =================================================================== diff -u -r069dee3a2428d3c6bb281db1844a372ae6e2063a -re4eceb1ac6e8091d10e0fab49d2d5a9c5e5f1c67 --- firmware/App/Modes/ModeStandby.c (.../ModeStandby.c) (revision 069dee3a2428d3c6bb281db1844a372ae6e2063a) +++ firmware/App/Modes/ModeStandby.c (.../ModeStandby.c) (revision e4eceb1ac6e8091d10e0fab49d2d5a9c5e5f1c67) @@ -7,8 +7,8 @@ * * @file ModeStandby.c * -* @author (last) Praneeth Bunne -* @date (last) 02-Jul-2026 +* @author (last) Arpita Srivastava +* @date (last) 18-May-2026 * * @author (original) Sean Nash * @date (original) 01-Aug-2024 @@ -27,8 +27,6 @@ #include "Switches.h" #include "SystemCommTD.h" #include "TxParams.h" -#include "Valve3Way.h" -#include "Valves.h" /** * @addtogroup TDStandbyMode @@ -44,9 +42,6 @@ static TD_STANDBY_STATE_T currentStandbyState; ///< Current state (sub-mode) of standby mode. static BOOL treatStartReqReceived; ///< Flag indicates user has requested initiation of a treatment. -static BOOL homingInitiated; ///< Flag indicates actuators have been homed. -static FLUID_TYPE_T fluidType; ///< Fluid type assigned based on user selection. -static TREATMENT_TYPE_T modality; ///< Modality from the treatment initiation. // ********** private function prototypes ********** @@ -57,16 +52,13 @@ * @brief * The initStandbyMode function initializes the Standby Mode Unit. * @details \b Inputs: none - * @details \b Outputs: Standby mode variables initialized. + * @details \b Outputs: currentStandbyState, treatStartReqReceived * @return none *************************************************************************/ void initStandbyMode( void ) { currentStandbyState = STANDBY_START_STATE; treatStartReqReceived = FALSE; - homingInitiated = FALSE; - fluidType = FLUID_TYPE_UNKNOWN; - modality = TREATMENT_MODALITY_HD_SALINE_FLUID; } /*********************************************************************//** @@ -92,22 +84,15 @@ setAlarmUserActionEnabled( ALARM_USER_ACTION_END_TREATMENT, FALSE ); // Pumps should be off - signalBloodPumpHardStop(); +// signalBloodPumpHardStop(); // stopSyringePump(); // Set valves to default positions - set3WayValveState( H13_VALV, VALVE_3WAY_COMMON_TO_CLOSED_STATE ); - set3WayValveState( H20_VALV, VALVE_3WAY_COMMON_TO_CLOSED_STATE ); - if ( getValveState( H1_VALV ) < VALVE_STATE_IDLE ) - { - setValvePosition( H1_VALV, VALVE_POSITION_A_INSERT_EJECT ); - } - if ( getValveState( H19_VALV ) < VALVE_STATE_IDLE ) - { - setValvePosition( H19_VALV, VALVE_POSITION_A_INSERT_EJECT ); - } +// setValveAirTrap( VALVE_3WAY_COMMON_TO_CLOSED_STATE ); +// setValvePosition( H1_VALV, VALVE_POSITION_A_INSERT_EJECT ); +// setValvePosition( H19, VALVE_POSITION_A_INSERT_EJECT ); - doorClosedRequired( FALSE ); // door no longer required to be closed in standby mode +// doorClosedRequired( FALSE ); // door no longer required to be closed in standby mode // Request DD service record and usage information from DD // sendDGServiceRequestToDG(); @@ -168,23 +153,23 @@ // Wait for door to be closed so we can home actuators // if ( STATE_CLOSED == getSwitchState( H9_SWCH ) ) // { - // If we haven't already initiated homing of actuators, initiate now - if ( homingInitiated != TRUE ) - { - VALVE_T valve; - - // Home pumps and valves - for ( valve = FIRST_VALVE; valve < NUM_OF_VALVES; ++valve ) - { - homeValve( valve, FALSE, TRUE ); - } +// // If we haven't already initiated homing of actuators, initiate now +// if ( homingInitiated != TRUE ) +// { +// VALVE_T valve; +// +// // Home pumps and valves +// for ( valve = VDI; valve < NUM_OF_VALVES; ++valve ) +// { +// homeValve( valve, VALVE_NO_FORCE_HOME, VALVE_CARTRIDGE_MAY_BE_PRESENT ); +// } // homeBloodPump(); // homeDialInPump(); // homeDialOutPump(); // retractSyringePump(); - - homingInitiated = TRUE; - } +// +// homingInitiated = TRUE; +// } // else // { // // If homing has been initiated, wait for syringe pump to home and the verify force sensor calibration @@ -284,67 +269,17 @@ // Start treatment workflow with pretreatment mode requestNewOperationMode( MODE_PRET ); treatStartReqReceived = FALSE; - // Set fluid type - setFluidType( modality ); } return state; } /*********************************************************************//** * @brief - * The setFluidType function sets the fluid type based on the user's - * treatment selection from the home screen. - * @details \b Inputs: none - * @details \b Outputs: fluidType - * @param modality Treatment modality selected by the user on the home screen. - * @return none - *************************************************************************/ -void setFluidType( TREATMENT_TYPE_T modality ) -{ - if ( TREATMENT_MODALITY_HD_SALINE_FLUID == modality ) - { - fluidType = FLUID_TYPE_SALINE; - } - else - { - // For HDF and HD_ONLINE_FLUID - fluidType = FLUID_TYPE_SUBSTITUTE; - } -} - -/*********************************************************************//** - * @brief - * The getFluidType function returns the current fluid type assigned - * based on the user's treatment selection. - * @details \b Inputs: none - * @details \b Outputs: none - * @return Current fluid type (saline or substitution fluid). - *************************************************************************/ -FLUID_TYPE_T getFluidType( void ) -{ - return fluidType; -} - -/*********************************************************************//** - * @brief - * The getModality function returns the treatment modality received from - * the UI at treatment initiation. - * @details \b Inputs: modality - * @details \b Outputs: none - * @return Treatment modality selected by the user on the home screen. - *************************************************************************/ -TREATMENT_TYPE_T getModality( void ) -{ - return modality; -} - -/*********************************************************************//** - * @brief * The signalUserInitiateTreatment function handles user initiation of a * treatment. * @details \b Inputs: none - * @details \b Outputs: treatStartReqReceived, modality + * @details \b Outputs: treatStartReqReceived * @param message initiate/reject treatment workflow message from UI which * includes the command code (0=cancel, 1=initiate). * @return TRUE if signal accepted, FALSE if not @@ -355,27 +290,20 @@ U32 cmd = 0; TD_OP_MODE_T mode = getCurrentOperationMode(); REQUEST_REJECT_REASON_CODE_T rejReason = REQUEST_REJECT_REASON_NONE; - INITIATE_TREATMENT_REQUEST_PAYLOAD_T request; UI_RESPONSE_PAYLOAD_T response; // Verify message payload length is valid - if ( sizeof( INITIATE_TREATMENT_REQUEST_PAYLOAD_T ) == message->hdr.payloadLen ) + if ( sizeof( U32 ) == message->hdr.payloadLen ) { - memcpy( &request, message->payload, sizeof( INITIATE_TREATMENT_REQUEST_PAYLOAD_T ) ); + memcpy( &cmd, message->payload, sizeof( U32 ) ); - cmd = request.command; - if ( USER_COMMAND_INITIATE == cmd ) { // Verify TD is in standby mode waiting for treatment start request if ( ( mode != MODE_STAN ) || ( STANDBY_WAIT_FOR_TREATMENT_STATE != currentStandbyState ) ) { rejReason = REQUEST_REJECT_REASON_NOT_ALLOWED_IN_CURRENT_MODE; } - else if ( request.modality >= NUM_OF_TREATMENT_MODALITY_TYPES ) - { - rejReason = REQUEST_REJECT_REASON_INVALID_COMMAND; - } #ifndef TEST_UI_ONLY // Verify DD is communicating with HD else if ( isDDCommunicating() != TRUE ) @@ -393,8 +321,6 @@ // If request to start treatment not rejected, set flag to initiate treatment workflow result = TRUE; treatStartReqReceived = TRUE; - // Save modality to set later - modality = (TREATMENT_TYPE_T)request.modality; } } else if ( USER_COMMAND_CANCEL == cmd )