frdm k64f usb work well, add kinetis_k to ci cmake
This commit is contained in:
@@ -36,14 +36,12 @@
|
||||
#define CI_FS_REG(_port) ((ci_fs_regs_t*) USB0_BASE)
|
||||
#define CI_REG CI_FS_REG(0)
|
||||
|
||||
void dcd_int_enable(uint8_t rhport)
|
||||
{
|
||||
void dcd_int_enable(uint8_t rhport) {
|
||||
(void) rhport;
|
||||
NVIC_EnableIRQ(USB0_IRQn);
|
||||
}
|
||||
|
||||
void dcd_int_disable(uint8_t rhport)
|
||||
{
|
||||
void dcd_int_disable(uint8_t rhport) {
|
||||
(void) rhport;
|
||||
NVIC_DisableIRQ(USB0_IRQn);
|
||||
}
|
||||
|
||||
@@ -271,9 +271,17 @@ void dcd_init(uint8_t rhport)
|
||||
{
|
||||
(void) rhport;
|
||||
|
||||
// save crystal-less setting (recovery clock)
|
||||
uint32_t clk_recover_irc_en = CI_REG->CLK_RECOVER_IRC_EN;
|
||||
uint32_t clk_recover_ctrl = CI_REG->CLK_RECOVER_CTRL;;
|
||||
|
||||
CI_REG->USBTRC0 |= USB_USBTRC0_USBRESET_MASK;
|
||||
while (CI_REG->USBTRC0 & USB_USBTRC0_USBRESET_MASK);
|
||||
|
||||
// restore crystal-less setting
|
||||
CI_REG->CLK_RECOVER_IRC_EN = clk_recover_irc_en;
|
||||
CI_REG->CLK_RECOVER_CTRL |= clk_recover_ctrl;
|
||||
|
||||
tu_memclr(&_dcd, sizeof(_dcd));
|
||||
CI_REG->USBTRC0 |= TU_BIT(6); /* software must set this bit to 1 */
|
||||
CI_REG->BDT_PAGE1 = (uint8_t)((uintptr_t)_dcd.bdt >> 8);
|
||||
|
||||
Reference in New Issue
Block a user