The interaction between scheduling and control of semi-cyclic hybrid systems