Skip to content

Commit 6688e5c

Browse files
committed
USBHost: fix CM4 build
1 parent a265a6c commit 6688e5c

File tree

1 file changed

+3
-1
lines changed

1 file changed

+3
-1
lines changed

libraries/USBHOST/src/stm32_otg_init.c

Lines changed: 3 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -388,7 +388,6 @@ static void tusb_otg_core_init(tusb_core_t* core)
388388
set_io_af_mode( OTG_HS_ULPI_CK );
389389

390390
NVIC_SetPriority(OTG_HS_IRQn, 0);
391-
NVIC_EnableIRQ(OTG_HS_IRQn);
392391
//NVIC_DisableIRQ(OTG_HS_IRQn);
393392

394393
NVIC_SetVector(OTG_HS_IRQn, (uint32_t)&OTG_HS_IRQHandler);
@@ -432,8 +431,10 @@ static void tusb_otg_core_init(tusb_core_t* core)
432431
// only HS core has DMA feature
433432
USBx->GAHBCFG |= USB_OTG_GAHBCFG_HBSTLEN_2;
434433
USBx->GAHBCFG |= USB_OTG_GAHBCFG_DMAEN;
434+
#ifdef CORE_CM7
435435
SCB_CleanInvalidateDCache();
436436
SCB_DisableDCache();
437+
#endif
437438
}
438439
#endif
439440
}
@@ -658,6 +659,7 @@ void tusb_open_host(tusb_host_t* host)
658659
USBx->GUSBCFG |= USB_OTG_GUSBCFG_FHMOD;
659660
memset(&host->state, 0, (sizeof(tusb_host_t) - (uint32_t) (&((tusb_host_t*)0)->state) ) );
660661
tusb_init_otg_host(host);
662+
NVIC_EnableIRQ(OTG_HS_IRQn);
661663
}
662664

663665

0 commit comments

Comments
 (0)