Merge pull request #13780 from JojoS62/PR-fix-H7-USB

STM32 H7: fix USB in sleep mode
pull/13973/head
Martin Kojtal 2020-11-26 13:19:35 +00:00 committed by GitHub
commit c9ff692858
No known key found for this signature in database
GPG Key ID: 4AEE18F83AFDEB23
1 changed files with 16 additions and 0 deletions

View File

@ -247,6 +247,14 @@ void USBPhyHw::init(USBPhyEvents *events)
hpcd.Init.use_external_vbus = DISABLE;
__HAL_RCC_USB_OTG_HS_CLK_ENABLE();
#ifdef __HAL_RCC_USB1_OTG_FS_ULPI_CLK_SLEEP_DISABLE
__HAL_RCC_USB1_OTG_FS_ULPI_CLK_SLEEP_DISABLE();
#endif
#ifdef __HAL_RCC_USB2_OTG_FS_ULPI_CLK_SLEEP_DISABLE
__HAL_RCC_USB2_OTG_FS_ULPI_CLK_SLEEP_DISABLE();
#endif
map = PinMap_USB_HS;
#elif (MBED_CONF_TARGET_USB_SPEED == USE_USB_OTG_FS)
@ -256,6 +264,14 @@ void USBPhyHw::init(USBPhyEvents *events)
hpcd.Init.speed = PCD_SPEED_FULL;
__HAL_RCC_USB_OTG_FS_CLK_ENABLE();
#ifdef __HAL_RCC_USB1_OTG_FS_ULPI_CLK_SLEEP_DISABLE
__HAL_RCC_USB1_OTG_FS_ULPI_CLK_SLEEP_DISABLE();
#endif
#ifdef __HAL_RCC_USB2_OTG_FS_ULPI_CLK_SLEEP_DISABLE
__HAL_RCC_USB2_OTG_FS_ULPI_CLK_SLEEP_DISABLE();
#endif
map = PinMap_USB_FS;
#elif (MBED_CONF_TARGET_USB_SPEED == USE_USB_NO_OTG)