Index: firmware/App/Modes/ModeStandby.c =================================================================== diff -u -r5366722d2325ea93db0ad1f696db78597af3b7c6 -raaf0b2d7a81e5ff2d97e0e5b42e6cf7f1ca8fd7f --- firmware/App/Modes/ModeStandby.c (.../ModeStandby.c) (revision 5366722d2325ea93db0ad1f696db78597af3b7c6) +++ firmware/App/Modes/ModeStandby.c (.../ModeStandby.c) (revision aaf0b2d7a81e5ff2d97e0e5b42e6cf7f1ca8fd7f) @@ -24,12 +24,14 @@ #include "ModeTreatment.h" #include "ModeStandby.h" #include "OperationModes.h" +#include "PinchValve.h" #include "Switches.h" #include "SystemCommTD.h" #include "TxParams.h" #include "Valve3Way.h" #include "Valves.h" + /** * @addtogroup TDStandbyMode * @{ @@ -48,6 +50,7 @@ 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 ********** static TD_STANDBY_STATE_T handleStandbyModeStartState( void ); @@ -98,11 +101,11 @@ // 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 ) + if ( VALVE_STATE_IDLE == getValveState( H1_VALV ) ) { setValvePosition( H1_VALV, VALVE_POSITION_A_INSERT_EJECT ); } - if ( getValveState( H19_VALV ) < VALVE_STATE_IDLE ) + if ( VALVE_STATE_IDLE == getValveState( H19_VALV ) ) { setValvePosition( H19_VALV, VALVE_POSITION_A_INSERT_EJECT ); } @@ -165,26 +168,23 @@ { TD_STANDBY_STATE_T state = STANDBY_WAIT_FOR_TREATMENT_STATE; - // 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; + // 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 ); - } + // Home pumps and valves + for ( valve = FIRST_VALVE; valve < NUM_OF_VALVES; ++valve ) + { + homeValve( valve, FALSE, TRUE ); + } // 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 @@ -224,6 +224,7 @@ DD_OP_MODE_T ddOperationMode = getDDOpMode(); F32 bicarbConvFactor = BICARBONATE_CONVERSION_FACTOR; + // switch ( dgOperationMode ) // { // case DG_MODE_GENE: @@ -291,6 +292,7 @@ return state; } + /*********************************************************************//** * @brief * The setFluidType function sets the fluid type based on the user's