diff options
author | Dean Camera <dean@fourwalledcubicle.com> | 2013-05-19 22:59:46 +0200 |
---|---|---|
committer | Dean Camera <dean@fourwalledcubicle.com> | 2013-05-19 22:59:46 +0200 |
commit | 151a1c5888f8806d7e2aaf6f29cfb6deae8321ae (patch) | |
tree | e4425b77d971006c018a7061fbda64ec2eb3083a /Demos/Device/LowLevel/RNDISEthernet/RNDISEthernet.c | |
parent | 329629a316e31cc91c6b56c54d5a9a06ce55dea7 (diff) | |
download | lufa-151a1c5888f8806d7e2aaf6f29cfb6deae8321ae.tar.gz lufa-151a1c5888f8806d7e2aaf6f29cfb6deae8321ae.tar.bz2 lufa-151a1c5888f8806d7e2aaf6f29cfb6deae8321ae.zip |
Port the device mode demos to the XMEGA architecture where applicable.
Diffstat (limited to 'Demos/Device/LowLevel/RNDISEthernet/RNDISEthernet.c')
-rw-r--r-- | Demos/Device/LowLevel/RNDISEthernet/RNDISEthernet.c | 12 |
1 files changed, 12 insertions, 0 deletions
diff --git a/Demos/Device/LowLevel/RNDISEthernet/RNDISEthernet.c b/Demos/Device/LowLevel/RNDISEthernet/RNDISEthernet.c index 52085f89c..2837a1088 100644 --- a/Demos/Device/LowLevel/RNDISEthernet/RNDISEthernet.c +++ b/Demos/Device/LowLevel/RNDISEthernet/RNDISEthernet.c @@ -62,12 +62,24 @@ int main(void) /** Configures the board hardware and chip peripherals for the demo's functionality. */ void SetupHardware(void) { +#if (ARCH == ARCH_AVR8) /* Disable watchdog if enabled by bootloader/fuses */ MCUSR &= ~(1 << WDRF); wdt_disable(); /* Disable clock division */ clock_prescale_set(clock_div_1); +#elif (ARCH == ARCH_XMEGA) + /* Start the PLL to multiply the 2MHz RC oscillator to 32MHz and switch the CPU core to run from it */ + XMEGACLK_StartPLL(CLOCK_SRC_INT_RC2MHZ, 2000000, F_CPU); + XMEGACLK_SetCPUClockSource(CLOCK_SRC_PLL); + + /* Start the 32MHz internal RC oscillator and start the DFLL to increase it to 48MHz using the USB SOF as a reference */ + XMEGACLK_StartInternalOscillator(CLOCK_SRC_INT_RC32MHZ); + XMEGACLK_StartDFLL(CLOCK_SRC_INT_RC32MHZ, DFLL_REF_INT_USBSOF, F_USB); + + PMIC.CTRL = PMIC_LOLVLEN_bm | PMIC_MEDLVLEN_bm | PMIC_HILVLEN_bm; +#endif /* Hardware Initialization */ LEDs_Init(); |