Index: firmware/App/Modes/ModeStandby.c =================================================================== diff -u -r365afa6b051eb4066db3adda1eeac77149aae7ba -r4c738395b1627aa36f30c14c2e374acf0e88f5f8 --- firmware/App/Modes/ModeStandby.c (.../ModeStandby.c) (revision 365afa6b051eb4066db3adda1eeac77149aae7ba) +++ firmware/App/Modes/ModeStandby.c (.../ModeStandby.c) (revision 4c738395b1627aa36f30c14c2e374acf0e88f5f8) @@ -149,15 +149,38 @@ if ( TRUE == startTest ) { startTest = FALSE; + startPos = TRUE; homePinchValve( H1_VALV ); homePinchValve( H19_VALV ); } - if ( TRUE == startPos ) + if ( ( TRUE == isPinchValveHomed( H1_VALV ) ) + && ( TRUE == isPinchValveHomed( H19_VALV ) ) && startPos == TRUE ) { - startPos = FALSE; - setPinchValvePosition( H1_VALV, VALVE_POSITION_C_CLOSE ); - setPinchValvePosition( H19_VALV, VALVE_POSITION_C_CLOSE ); + static U32 p = 1; + static U32 d = 0; + + if ( ( TRUE != isPinchValveBusy( H1_VALV ) ) + && ( TRUE != isPinchValveBusy( H19_VALV ) ) ) + { + if ( ++d > 40 ) + { + d = 0; + setPinchValvePosition( H1_VALV, p ); + setPinchValvePosition( H19_VALV, p ); + p++; + if ( p >= NUM_OF_VALVE_POSITIONS ) + { + p = 1; + } + } + } } +// if ( TRUE == startPos ) +// { +// startPos = FALSE; +// setPinchValvePosition( H1_VALV, VALVE_POSITION_B_OPEN ); +// setPinchValvePosition( H19_VALV, VALVE_POSITION_B_OPEN ); +// } #endif // State machine for standby mode