Index: firmware/App/Modes/ModeStandby.c =================================================================== diff -u -rcc3f9f20ed1a76552e2f433f4cbb7a9f2ae67713 -r62aa7e7cbfb6b0dd33987a086df53481ffe4420c --- firmware/App/Modes/ModeStandby.c (.../ModeStandby.c) (revision cc3f9f20ed1a76552e2f433f4cbb7a9f2ae67713) +++ firmware/App/Modes/ModeStandby.c (.../ModeStandby.c) (revision 62aa7e7cbfb6b0dd33987a086df53481ffe4420c) @@ -24,15 +24,13 @@ #include "ModeTreatment.h" #include "ModeStandby.h" #include "OperationModes.h" -#include "PinchValve.h" #include "Switches.h" #include "SyringePump.h" #include "SystemCommTD.h" #include "TxParams.h" #include "Valve3Way.h" #include "Valves.h" - /** * @addtogroup TDStandbyMode * @{ @@ -166,49 +164,78 @@ *************************************************************************/ static TD_STANDBY_STATE_T handleStandbyModeStartState( void ) { - TD_STANDBY_STATE_T state = STANDBY_WAIT_FOR_TREATMENT_STATE; + TD_STANDBY_STATE_T state = STANDBY_START_STATE; - // If we haven't already initiated homing of actuators, initiate now - if ( homingInitiated != TRUE ) + if ( FALSE == homingInitiated ) { VALVE_T valve; - - // Home pumps and valves + // Initiate homing for both pinch valves. for ( valve = FIRST_VALVE; valve < NUM_OF_VALVES; ++valve ) { homeValve( valve, FALSE, TRUE ); } -// homeBloodPump(); -// homeDialInPump(); -// homeDialOutPump(); -// retractSyringePump(); - homingInitiated = TRUE; } -// else + else if ( ( VALVE_STATE_IDLE == getValveState( H1_VALV ) ) && + ( VALVE_STATE_IDLE == getValveState( H19_VALV ) ) ) + { + // After homing completes, move both pinch valves to Position A. + setValvePosition( H1_VALV, VALVE_POSITION_A_INSERT_EJECT ); + setValvePosition( H19_VALV, VALVE_POSITION_A_INSERT_EJECT ); + homingInitiated = FALSE; + state = STANDBY_WAIT_FOR_TREATMENT_STATE; + } + + return state; +} + + +//static TD_STANDBY_STATE_T handleStandbyModeStartState( void ) +//{ +// TD_STANDBY_STATE_T state = STANDBY_WAIT_FOR_TREATMENT_STATE; +// +// // 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 ) // { -// // If homing has been initiated, wait for syringe pump to home and the verify force sensor calibration -//#ifndef _RELEASE_ -// if ( SW_CONFIG_ENABLE_VALUE == getSoftwareConfigStatus( SW_CONFIG_DISABLE_SYRINGE_PUMP ) ) -// { -// state = STANDBY_WAIT_FOR_TREATMENT_STATE; // Go to wait for treatment state after above check -// } -// else -//#endif -// { -// if ( ( TRUE == isSyringePumpHome() ) && ( TRUE == isSyringePumpStopped() ) ) -// { -// syringePumpVerifyForceSensorDACCalibration(); -// homingInitiated = FALSE; // reset for next time -// doorClosedRequired( FALSE ); // door no longer required to be closed in standby mode -// state = STANDBY_WAIT_FOR_TREATMENT_STATE; // Go to wait for treatment state after above check -// } -// } +// homeValve( valve, FALSE, TRUE ); // } +//// homeBloodPump(); +//// homeDialInPump(); +//// homeDialOutPump(); +//// retractSyringePump(); +// +// homingInitiated = TRUE; // } +//// else +//// { +//// // If homing has been initiated, wait for syringe pump to home and the verify force sensor calibration +////#ifndef _RELEASE_ +//// if ( SW_CONFIG_ENABLE_VALUE == getSoftwareConfigStatus( SW_CONFIG_DISABLE_SYRINGE_PUMP ) ) +//// { +//// state = STANDBY_WAIT_FOR_TREATMENT_STATE; // Go to wait for treatment state after above check +//// } +//// else +////#endif +//// { +//// if ( ( TRUE == isSyringePumpHome() ) && ( TRUE == isSyringePumpStopped() ) ) +//// { +//// syringePumpVerifyForceSensorDACCalibration(); +//// homingInitiated = FALSE; // reset for next time +//// doorClosedRequired( FALSE ); // door no longer required to be closed in standby mode +//// state = STANDBY_WAIT_FOR_TREATMENT_STATE; // Go to wait for treatment state after above check +//// } +//// } +//// } +//// } +// +// return state; +//} - return state; -} /*********************************************************************//** * @brief * The handleStandbyModeWaitForTreatmentState function handles wait for @@ -223,7 +250,6 @@ DD_OP_MODE_T ddOperationMode = getDDOpMode(); F32 bicarbConvFactor = BICARBONATE_CONVERSION_FACTOR; - // switch ( dgOperationMode ) // { // case DG_MODE_GENE: @@ -291,7 +317,6 @@ return state; } - /*********************************************************************//** * @brief * The setFluidType function sets the fluid type based on the user's Index: firmware/App/Services/Messaging.c =================================================================== diff -u -r4a5a809459e76f558dce420dedf20f3de5b4a7a1 -r62aa7e7cbfb6b0dd33987a086df53481ffe4420c --- firmware/App/Services/Messaging.c (.../Messaging.c) (revision 4a5a809459e76f558dce420dedf20f3de5b4a7a1) +++ firmware/App/Services/Messaging.c (.../Messaging.c) (revision 62aa7e7cbfb6b0dd33987a086df53481ffe4420c) @@ -16,7 +16,6 @@ ***************************************************************************/ #include // For memcpy() - #include "AirPump.h" #include "AirTrap.h" #include "AlarmMgmt.h" @@ -27,6 +26,7 @@ #include "Compatible.h" #include "CpldInterface.h" #include "DDInterface.h" +#include "DrySelfTests.h" #include "Ejector.h" #include "FluidBolus.h" #include "FpgaTD.h" @@ -39,6 +39,7 @@ #include "OperationModes.h" #include "PAL.h" #include "Pressures.h" +#include "Prime.h" #include "StateTxBloodPrime.h" #include "StateTxDialysis.h" #include "StateTxPaused.h" @@ -137,6 +138,7 @@ { MSG_ID_UI_TREATMENT_SET_POINT_DIALYSATE_TEMP_CHANGE_REQUEST, &validateAndSetDialysateTemperature }, { MSG_ID_UI_BLOOD_PRIME_CMD_REQUEST, &bloodPrimeHandleCmdRequest }, { MSG_ID_UI_TREATMENT_SET_POINT_BLOOD_FLOW_CHANGE_REQUEST, &bloodPrimeHandleBloodFlowChangeRequest }, + { MSG_ID_UI_TUBE_SET_AUTHENTICATION_ACK_RESPONSE, &drySelfTestHandleTubingSetAuthResponse }, { MSG_ID_UI_ADJUST_DISPOSABLES_CONFIRM_REQUEST, &handleAutoLoadRequest }, { MSG_ID_UI_SETUP_TUBING_SET_CONNECTIONS_CONFIRM_REQUEST, &handleSetupTubingSetConnectionConfirmRequest }, { MSG_ID_UI_ADJUST_DISPOSABLES_REMOVAL_CONFIRM_REQUEST, &handleAutoEjectRequest }, @@ -205,6 +207,7 @@ { MSG_ID_TD_HARD_STOP_BLOOD_PUMP, &testHardStopBloodPump }, { MSG_ID_TD_AIR_PUMP_POWER_RAISE_OVERRIDE_REQUEST, &testAirPumpPowerRaiseOverride }, { MSG_ID_TD_AIR_PUMP_POWER_LOWER_OVERRIDE_REQUEST, &testAirPumpPowerLowerOverride }, + { MSG_ID_TD_HARD_STOP_BLOOD_PUMP, &testHardStopBloodPump }, { MSG_ID_TD_BARO_MFG_CRC_OVERRIDE, &testBaroPressureMFGCRCOverride }, { MSG_ID_TD_BARO_PRESSURE_OVERRIDE, &testBaroPressureOverride }, { MSG_ID_TD_TEMPERATURE_OVERRIDE, &testTemperatureOverride }, @@ -229,6 +232,7 @@ { MSG_ID_TD_GET_ALARM_PROPERTIES_REQUEST, &testGetAlarmPropertiesRequest }, { MSG_ID_TD_RINSEBACK_VOLUME_OVERRIDE, &testRinsebackVolumeOverride }, { MSG_ID_TD_RINSEBACK_PUBLISH_INTERVAL_OVERRIDE_REQUEST, &testRinsebackPublishIntervalOverride }, + { MSG_ID_TD_PRIME_PUBLISH_INTERVAL_OVERRIDE, &testPrimePublishIntervalOverride }, }; /// Number of entries in the message handling function lookup table.