Dynamic multi-clock management for embedded systems