Index: firmware/App/Controllers/Valves.c =================================================================== diff -u -r046ffdda014e511363b04ed523eb3399a3eb4ad0 -r2b760b79a846c77a932b6df6c489faee96a544a0 --- firmware/App/Controllers/Valves.c (.../Valves.c) (revision 046ffdda014e511363b04ed523eb3399a3eb4ad0) +++ firmware/App/Controllers/Valves.c (.../Valves.c) (revision 2b760b79a846c77a932b6df6c489faee96a544a0) @@ -21,6 +21,7 @@ #include "Messaging.h" #include "OperationModes.h" #include "PersistentAlarm.h" +#include "PinchValve.h" #include "TaskGeneral.h" #include "Timers.h" #include "Valves.h" @@ -118,7 +119,7 @@ void initValves( void ) { // Initialize driver - initRotaryValvesDriver(); + initPinchValveDriver(); // Initialize controller variables memset( ¤tValveStates[0], 0, sizeof( currentValveStates ) ); @@ -153,24 +154,15 @@ BOOL homeValve( VALVE_T valve, BOOL force, BOOL cartridge ) { BOOL result = FALSE; - + (void)force; + (void)cartridge; if ( valve < NUM_OF_VALVES ) { - VALVE_STATE_T currState = currentValveStates[ valve ].controlState; - - if ( ( VALVE_STATE_HOMING_NOT_STARTED == currState ) || ( VALVE_STATE_IDLE == currState ) ) + result = homePinchValve( valve ); + if ( TRUE == result ) { - // If haven't already homed the valves, home the valves - if ( ( currentValveStates[ valve ].hasValveBeenHomed != TRUE ) || ( VALVE_FORCE_HOME == force ) ) - { - currentValveStates[ valve ].hasHomingBeenRequested = TRUE; - } - // Otherwise, go to position A (home position) - else - { - setValvePosition( valve, VALVE_POSITION_A_INSERT_EJECT ); - } - result = TRUE; + currentValveStates[valve].hasHomingBeenRequested = TRUE; + currentValveStates[valve].controlState = VALVE_STATE_IN_TRANSITION; } } else