Index: firmware/App/Controllers/Valves.c =================================================================== diff -u -r556e92463ab2f246b151d31d8bcd96b3ee87ad3f -re3f1eb69b9178243dad8788a6d53be148c21fc84 --- firmware/App/Controllers/Valves.c (.../Valves.c) (revision 556e92463ab2f246b151d31d8bcd96b3ee87ad3f) +++ firmware/App/Controllers/Valves.c (.../Valves.c) (revision e3f1eb69b9178243dad8788a6d53be148c21fc84) @@ -24,6 +24,7 @@ #include "NVDataMgmt.h" #include "SafetyShutdown.h" #include "SystemCommMessages.h" +#include "Switches.h" #include "TaskPriority.h" #include "Timers.h" #include "Valves.h" @@ -617,16 +618,20 @@ *************************************************************************/ static VALVE_STATE_T handleValveStateHomingNotStarted( VALVE_T valve ) { - VALVE_STATE_T state = VALVE_STATE_HOMING_NOT_STARTED; + VALVE_STATE_T state = VALVE_STATE_HOMING_NOT_STARTED; + OPN_CLS_STATE_T frontDoor = getSwitchStatus( FRONT_DOOR ); - // TODO connect this flag to the doors driver later - // For now it is assumed the door is closed - BOOL isDoorClosed = TRUE; +#ifndef _RELEASE_ + if ( SW_CONFIG_ENABLE_VALUE == getSoftwareConfigStatus( SW_CONFIG_DISABLE_SWITCHES_MONITOR ) ) + { + frontDoor = STATE_CLOSED; + } +#endif // If homing has been requested or POST is completed and the door has been close for the specified - // Period of time, start the homing - if ( valveSelfTestState == VALVE_SELF_TEST_COMPLETE && ( valvesStatus[ valve ].hasHomingBeenRequested || isDoorClosed ) - && ( ! valvesStatus[ valve ].hasHomingFailed ) ) + // Period of time, start the homing process + if ( ( VALVE_SELF_TEST_COMPLETE == valveSelfTestState ) && ( ( TRUE == valvesStatus[ valve ].hasHomingBeenRequested ) || ( STATE_CLOSED == frontDoor ) ) + && ( FALSE == valvesStatus[ valve ].hasHomingFailed ) ) { // Get ready for the energized state valvesStatus[ valve ].homingEdgeDetectionCounter = 0;