Skip to content

Commit a6481d5

Browse files
committed
Fix operations when calling delay()
1 parent 8cf65d4 commit a6481d5

File tree

1 file changed

+8
-1
lines changed

1 file changed

+8
-1
lines changed

src/targets/TARGET_STM/USBHALHost_STM.h

Lines changed: 8 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -301,8 +301,15 @@ USBHALHost::USBHALHost()
301301
__HAL_RCC_USB_OTG_FS_CLK_ENABLE();
302302
#endif
303303

304+
#ifdef __HAL_RCC_USB1_OTG_FS_ULPI_CLK_SLEEP_DISABLE
305+
__HAL_RCC_USB1_OTG_FS_ULPI_CLK_SLEEP_DISABLE();
306+
#endif
307+
#ifdef __HAL_RCC_USB2_OTG_FS_ULPI_CLK_SLEEP_DISABLE
308+
__HAL_RCC_USB2_OTG_FS_ULPI_CLK_SLEEP_DISABLE();
309+
#endif
310+
304311
// Set USB interrupt
305-
HAL_NVIC_SetPriority(USBHAL_IRQn, 5, 0);
312+
HAL_NVIC_SetPriority(USBHAL_IRQn, 0, 0);
306313
NVIC_SetVector(USBHAL_IRQn, (uint32_t)&_usbisr);
307314
}
308315

0 commit comments

Comments
 (0)