/* Change the source of the main system clock.  */
void sysclk_set_source(uint_fast8_t src)
/* Change the source of the main system clock.  */
void sysclk_set_source(uint_fast8_t src)
{
	irqflags_t flags;
	Assert(src <= SYSCLK_SRC_PLL1);
	flags = cpu_irq_save();
	AVR32_PM.unlock = 0xaa000000 | AVR32_PM_MCCTRL;
	AVR32_PM.mcctrl = src;
	cpu_irq_restore(flags);
}