[powerdebug 00/23] Rewrite of the clock code