aboutsummaryrefslogtreecommitdiffstats
path: root/LUFA/Platform/UC3/ClockManagement.h
diff options
context:
space:
mode:
authorDean Camera <dean@fourwalledcubicle.com>2011-07-14 11:31:12 +0000
committerDean Camera <dean@fourwalledcubicle.com>2011-07-14 11:31:12 +0000
commitffa8b430c1886b696e1e94039e6a9343b5b81dbd (patch)
tree3a3734b821fb7e4406a0868c3b1c498b212d0a74 /LUFA/Platform/UC3/ClockManagement.h
parentc8e517646538669c290c5566231c8ec2b02f33bc (diff)
downloadlufa-ffa8b430c1886b696e1e94039e6a9343b5b81dbd.tar.gz
lufa-ffa8b430c1886b696e1e94039e6a9343b5b81dbd.tar.bz2
lufa-ffa8b430c1886b696e1e94039e6a9343b5b81dbd.zip
Complete initial revision of the XMEGA Clock Management platform driver.
Start the USB clock source generator inside USB_ResetInterface() for XMEGA devices.
Diffstat (limited to 'LUFA/Platform/UC3/ClockManagement.h')
-rw-r--r--LUFA/Platform/UC3/ClockManagement.h17
1 files changed, 11 insertions, 6 deletions
diff --git a/LUFA/Platform/UC3/ClockManagement.h b/LUFA/Platform/UC3/ClockManagement.h
index d6fac358a..125a8a9b5 100644
--- a/LUFA/Platform/UC3/ClockManagement.h
+++ b/LUFA/Platform/UC3/ClockManagement.h
@@ -123,12 +123,12 @@
*
* \return Boolean \c true if the external oscillator was successfully started, \c false if invalid parameters specified.
*/
- static inline uint8_t AVR32CLK_StartExternalOscillator(const uint8_t Channel,
- const uint8_t Type,
- const uint8_t Startup) ATTR_ALWAYS_INLINE;
- static inline uint8_t AVR32CLK_StartExternalOscillator(const uint8_t Channel,
- const uint8_t Type,
- const uint8_t Startup)
+ static inline bool AVR32CLK_StartExternalOscillator(const uint8_t Channel,
+ const uint8_t Type,
+ const uint8_t Startup) ATTR_ALWAYS_INLINE;
+ static inline bool AVR32CLK_StartExternalOscillator(const uint8_t Channel,
+ const uint8_t Type,
+ const uint8_t Startup)
{
switch (Channel)
{
@@ -162,6 +162,8 @@
/** Starts the given PLL of the UC3 microcontroller, with the given options. This routine blocks until the PLL is ready for use.
*
+ * \note The output frequency must be equal to or greater than the source frequency.
+ *
* \param[in] Channel Index of the PLL to start.
* \param[in] Source Clock source for the PLL, a value from \ref UC3_System_ClockSource_t.
* \param[in] SourceFreq Frequency of the PLL's clock source, in Hz.
@@ -178,6 +180,9 @@
const uint32_t SourceFreq,
const uint32_t Frequency)
{
+ if (SourceFreq > Frequency)
+ return false;
+
switch (Source)
{
case CLOCK_SRC_OSC0: