From f4528c4aefcadd3342e9de2360d4c48196394fde Mon Sep 17 00:00:00 2001 From: Dean Camera Date: Thu, 14 Jul 2011 02:58:07 +0000 Subject: Add high speed USB support for the UC3 devices containing a high speed USB controller. Add device support preprocessor checks and use symbolic bit names in the UC3 platform clock management driver. --- LUFA/Platform/UC3/ClockManagement.h | 20 +++++++++++++------- 1 file changed, 13 insertions(+), 7 deletions(-) (limited to 'LUFA/Platform') diff --git a/LUFA/Platform/UC3/ClockManagement.h b/LUFA/Platform/UC3/ClockManagement.h index 60a3d18f4..608702069 100644 --- a/LUFA/Platform/UC3/ClockManagement.h +++ b/LUFA/Platform/UC3/ClockManagement.h @@ -233,19 +233,19 @@ switch (Source) { case CLOCK_SRC_OSC0: - AVR32_PM.GCCTRL[Channel].pllsel = 0; + AVR32_PM.GCCTRL[Channel].pllsel = false; AVR32_PM.GCCTRL[Channel].oscsel = 0; break; case CLOCK_SRC_OSC1: - AVR32_PM.GCCTRL[Channel].pllsel = 0; + AVR32_PM.GCCTRL[Channel].pllsel = false; AVR32_PM.GCCTRL[Channel].oscsel = 1; break; case CLOCK_SRC_PLL0: - AVR32_PM.GCCTRL[Channel].pllsel = 1; + AVR32_PM.GCCTRL[Channel].pllsel = true; AVR32_PM.GCCTRL[Channel].oscsel = 0; break; case CLOCK_SRC_PLL1: - AVR32_PM.GCCTRL[Channel].pllsel = 1; + AVR32_PM.GCCTRL[Channel].pllsel = true; AVR32_PM.GCCTRL[Channel].oscsel = 1; break; default: @@ -291,15 +291,21 @@ switch (Source) { + #if defined(AVR32_PM_MCCTRL_MCSEL_SLOW) case CLOCK_SRC_SLOW_CLK: - AVR32_PM.MCCTRL.mcsel = 0; + AVR32_PM.MCCTRL.mcsel = AVR32_PM_MCCTRL_MCSEL_SLOW; break; + #endif + #if defined(AVR32_PM_MCCTRL_MCSEL_OSC0) case CLOCK_SRC_OSC0: - AVR32_PM.MCCTRL.mcsel = 1; + AVR32_PM.MCCTRL.mcsel = AVR32_PM_MCCTRL_MCSEL_OSC0; break; + #endif + #if defined(AVR32_PM_MCCTRL_MCSEL_PLL0) case CLOCK_SRC_PLL0: - AVR32_PM.MCCTRL.mcsel = 2; + AVR32_PM.MCCTRL.mcsel = AVR32_PM_MCCTRL_MCSEL_PLL0; break; + #endif default: return false; } -- cgit v1.2.3