Skip to content
GitLab
Menu
Projects
Groups
Snippets
/
Help
Help
Support
Community forum
Keyboard shortcuts
?
Submit feedback
Contribute to GitLab
Sign in
Toggle navigation
Menu
Open sidebar
Erik Strand
lufa
Commits
fae71b57
Commit
fae71b57
authored
Jun 10, 2012
by
Dean Camera
Browse files
Minor correction to the UC3 USB clock division formula (thanks to Kim Blomqvist).
parent
857641b9
Changes
1
Hide whitespace changes
Inline
Side-by-side
LUFA/Drivers/USB/Core/UC3/USBController_UC3.c
View file @
fae71b57
...
...
@@ -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
();
...
...
Write
Preview
Supports
Markdown
0%
Try again
or
attach a new file
.
Attach a file
Cancel
You are about to add
0
people
to the discussion. Proceed with caution.
Finish editing this message first!
Cancel
Please
register
or
sign in
to comment