Digital control of continuous-time switching systems with safety constraints