mirror of
https://github.com/hathach/tinyusb.git
synced 2025-01-31 05:52:55 +08:00
Merge pull request #1221 from kasjer/kasjer/fix-nrf5x-vbus-race-condition
nrf5x: Fix race condition during startup
This commit is contained in:
commit
6bf7fba2a4
@ -1059,7 +1059,13 @@ void tusb_hal_nrf_power_event (uint32_t event)
|
||||
|
||||
// Enable interrupt, priorities should be set by application
|
||||
NVIC_ClearPendingIRQ(USBD_IRQn);
|
||||
NVIC_EnableIRQ(USBD_IRQn);
|
||||
// Don't enable USBD interrupt yet, if dcd_init() did not finish yet
|
||||
// Interrupt will be enabled by tud_init(), when USB stack is ready
|
||||
// to handle interrupts.
|
||||
if (tud_inited())
|
||||
{
|
||||
NVIC_EnableIRQ(USBD_IRQn);
|
||||
}
|
||||
|
||||
// Wait for HFCLK
|
||||
while ( !hfclk_running() ) { }
|
||||
|
Loading…
x
Reference in New Issue
Block a user