Control of switching constrained systems under state and input constraints