Discrete synchronization of hybrid systems