Control of forward-reverse switching