Skip to content

Commit 65a2e5c

Browse files
committed
fix build with cpu without USB_CLK_RECOVER using old dcd_khci driver
1 parent 354998e commit 65a2e5c

File tree

2 files changed

+5
-1
lines changed

2 files changed

+5
-1
lines changed

.idea/cmake.xml

Lines changed: 1 addition & 1 deletion
Some generated files are not rendered by default. Learn more about customizing how changed files appear on GitHub.

src/portable/nxp/khci/dcd_khci.c

Lines changed: 4 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -270,15 +270,19 @@ void dcd_init(uint8_t rhport)
270270
(void) rhport;
271271

272272
// save crystal-less setting (recovery clock)
273+
#ifdef USB_CLK_RECOVER_IRC_EN_IRC_EN
273274
uint32_t clk_recover_irc_en = KHCI->CLK_RECOVER_IRC_EN;
274275
uint32_t clk_recover_ctrl = KHCI->CLK_RECOVER_CTRL;
276+
#endif
275277

276278
KHCI->USBTRC0 |= USB_USBTRC0_USBRESET_MASK;
277279
while (KHCI->USBTRC0 & USB_USBTRC0_USBRESET_MASK);
278280

279281
// restore crystal-less setting
282+
#ifdef USB_CLK_RECOVER_IRC_EN_IRC_EN
280283
KHCI->CLK_RECOVER_IRC_EN = clk_recover_irc_en;
281284
KHCI->CLK_RECOVER_CTRL |= clk_recover_ctrl;
285+
#endif
282286

283287
tu_memclr(&_dcd, sizeof(_dcd));
284288
KHCI->USBTRC0 |= TU_BIT(6); /* software must set this bit to 1 */

0 commit comments

Comments
 (0)