diff options
author | Michael Walker <walkerstop@gmail.com> | 2018-05-01 00:46:42 -0700 |
---|---|---|
committer | Michael Walker <walkerstop@gmail.com> | 2018-05-01 00:46:42 -0700 |
commit | 7506c2a2c158513ab3db9d382495e089725d79f3 (patch) | |
tree | d6a25906fb7a40fb2eafc9c829c654516921151c /os/hal/ports/KINETIS | |
parent | 547c570af0dec888252c8ba87942f303567af5b6 (diff) | |
download | ChibiOS-Contrib-7506c2a2c158513ab3db9d382495e089725d79f3.tar.gz ChibiOS-Contrib-7506c2a2c158513ab3db9d382495e089725d79f3.tar.bz2 ChibiOS-Contrib-7506c2a2c158513ab3db9d382495e089725d79f3.zip |
support Teensy 3.6
Diffstat (limited to 'os/hal/ports/KINETIS')
-rw-r--r-- | os/hal/ports/KINETIS/LLD/hal_usb_lld.c | 8 |
1 files changed, 7 insertions, 1 deletions
diff --git a/os/hal/ports/KINETIS/LLD/hal_usb_lld.c b/os/hal/ports/KINETIS/LLD/hal_usb_lld.c index e8d9778..77421c8 100644 --- a/os/hal/ports/KINETIS/LLD/hal_usb_lld.c +++ b/os/hal/ports/KINETIS/LLD/hal_usb_lld.c @@ -398,15 +398,21 @@ void usb_lld_init(void) { #if KINETIS_USB_USE_USB0
+ /* Set USB clock source to MCGPLLCLK, MCGFLLCLK, USB1 PFD, or IRC48M */
SIM->SOPT2 |= SIM_SOPT2_USBSRC;
-#if defined(K20x5) || defined(K20x7)
+#if defined(K20x5) || defined(K20x7) || defined(MK66F18)
#if KINETIS_MCG_MODE == KINETIS_MCG_MODE_FEI
/* MCGOUTCLK is the SYSCLK frequency, so don't divide for USB clock */
SIM->CLKDIV2 = SIM_CLKDIV2_USBDIV(0);
+#if defined(MK66F18)
+ /* Switch from default MCGPLLCLK to IRC48M for USB */
+ SIM->SOPT2 |= SIM_SOPT2_PLLFLLSEL_SET(3);
+#endif
+
#elif KINETIS_MCG_MODE == KINETIS_MCG_MODE_PEE
#define KINETIS_USBCLK_FREQUENCY 48000000UL
|