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); | ||||
|   | ||||
| @@ -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 */ | ||||
|   | ||||
		Reference in New Issue
	
	Block a user
	 hathach
					hathach