aboutsummaryrefslogtreecommitdiffstats
path: root/os
diff options
context:
space:
mode:
authorMichael Walker <walkerstop@gmail.com>2018-05-01 00:46:42 -0700
committerMichael Walker <walkerstop@gmail.com>2018-05-01 00:46:42 -0700
commit7506c2a2c158513ab3db9d382495e089725d79f3 (patch)
treed6a25906fb7a40fb2eafc9c829c654516921151c /os
parent547c570af0dec888252c8ba87942f303567af5b6 (diff)
downloadChibiOS-Contrib-7506c2a2c158513ab3db9d382495e089725d79f3.tar.gz
ChibiOS-Contrib-7506c2a2c158513ab3db9d382495e089725d79f3.tar.bz2
ChibiOS-Contrib-7506c2a2c158513ab3db9d382495e089725d79f3.zip
support Teensy 3.6
Diffstat (limited to 'os')
-rw-r--r--os/hal/ports/KINETIS/LLD/hal_usb_lld.c8
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