frdm k64f usb work well, add kinetis_k to ci cmake

This commit is contained in:
hathach
2024-02-24 00:36:07 +07:00
parent a1bfde83fb
commit 3d3bf45102
8 changed files with 60 additions and 19 deletions

View File

@@ -269,22 +269,16 @@ void dcd_init(uint8_t rhport)
{
(void) rhport;
#if (CFG_TUSB_MCU == OPT_MCU_KINETIS_K)
uint32_t clk_recover_irc_en;
uint32_t clk_recover_ctrl;
clk_recover_irc_en = KHCI->CLK_RECOVER_IRC_EN;
clk_recover_ctrl = KHCI->CLK_RECOVER_CTRL;
// save crystal-less setting (recovery clock)
uint32_t clk_recover_irc_en = KHCI->CLK_RECOVER_IRC_EN;
uint32_t clk_recover_ctrl = KHCI->CLK_RECOVER_CTRL;
KHCI->USBTRC0 |= USB_USBTRC0_USBRESET_MASK;
while (KHCI->USBTRC0 & USB_USBTRC0_USBRESET_MASK);
// restore crystal-less setting
KHCI->CLK_RECOVER_IRC_EN = clk_recover_irc_en;
KHCI->CLK_RECOVER_CTRL |= clk_recover_ctrl;
#else
KHCI->USBTRC0 |= USB_USBTRC0_USBRESET_MASK;
while (KHCI->USBTRC0 & USB_USBTRC0_USBRESET_MASK);
#endif
tu_memclr(&_dcd, sizeof(_dcd));
KHCI->USBTRC0 |= TU_BIT(6); /* software must set this bit to 1 */