diff options
author | Dean Camera <dean@fourwalledcubicle.com> | 2012-06-10 15:59:09 +0000 |
---|---|---|
committer | Dean Camera <dean@fourwalledcubicle.com> | 2012-06-10 15:59:09 +0000 |
commit | fae71b578068827f0357db91fa7b9e72ec6d5d32 (patch) | |
tree | 78b1821905b313351e839f6d92e2679ea341a18b | |
parent | 857641b98e0ad1f7d30ae1fc8fc63f97018ae711 (diff) | |
download | lufa-fae71b578068827f0357db91fa7b9e72ec6d5d32.tar.gz lufa-fae71b578068827f0357db91fa7b9e72ec6d5d32.tar.bz2 lufa-fae71b578068827f0357db91fa7b9e72ec6d5d32.zip |
Minor correction to the UC3 USB clock division formula (thanks to Kim Blomqvist).
-rw-r--r-- | LUFA/Drivers/USB/Core/UC3/USBController_UC3.c | 2 |
1 files changed, 1 insertions, 1 deletions
diff --git a/LUFA/Drivers/USB/Core/UC3/USBController_UC3.c b/LUFA/Drivers/USB/Core/UC3/USBController_UC3.c index 9e4e4a211..6a3df6e7c 100644 --- a/LUFA/Drivers/USB/Core/UC3/USBController_UC3.c +++ b/LUFA/Drivers/USB/Core/UC3/USBController_UC3.c @@ -112,7 +112,7 @@ void USB_ResetInterface(void) AVR32_PM.GCCTRL[AVR32_PM_GCLK_USBB].pllsel = !(USB_Options & USB_OPT_GCLK_SRC_OSC); AVR32_PM.GCCTRL[AVR32_PM_GCLK_USBB].oscsel = !(USB_Options & USB_OPT_GCLK_CHANNEL_0); AVR32_PM.GCCTRL[AVR32_PM_GCLK_USBB].diven = (F_USB != USB_CLOCK_REQUIRED_FREQ); - AVR32_PM.GCCTRL[AVR32_PM_GCLK_USBB].div = (F_USB == USB_CLOCK_REQUIRED_FREQ) ? 0 : (uint32_t)(((F_USB / USB_CLOCK_REQUIRED_FREQ) - 1) / 2); + AVR32_PM.GCCTRL[AVR32_PM_GCLK_USBB].div = (F_USB == USB_CLOCK_REQUIRED_FREQ) ? 0 : (uint32_t)((F_USB / USB_CLOCK_REQUIRED_FREQ / 2) - 1); AVR32_PM.GCCTRL[AVR32_PM_GCLK_USBB].cen = true; USB_INT_DisableAllInterrupts(); |