mirror of
https://github.com/openmv/openmv.git
synced 2025-11-04 14:49:50 +08:00
Enable USB clock during sleep.
This commit is contained in:
parent
6339815ae3
commit
50d27dacee
@ -27,6 +27,7 @@
|
||||
|
||||
/* Includes ------------------------------------------------------------------*/
|
||||
#include STM32_HAL_H
|
||||
#include "stm32_hal_legacy.h"
|
||||
#include "usbdev/usbd_core.h"
|
||||
|
||||
/* Private typedef -----------------------------------------------------------*/
|
||||
@ -79,6 +80,12 @@ void HAL_PCD_MspInit(PCD_HandleTypeDef *hpcd)
|
||||
HAL_GPIO_Init(GPIOA, &GPIO_InitStruct);
|
||||
#endif
|
||||
|
||||
#if defined(MCU_SERIES_H7)
|
||||
// Keep USB clock running during sleep or else __WFI() will disable the USB
|
||||
__HAL_RCC_USB2_OTG_FS_CLK_SLEEP_ENABLE();
|
||||
__HAL_RCC_USB2_OTG_FS_ULPI_CLK_SLEEP_DISABLE();
|
||||
#endif
|
||||
|
||||
/* Enable USB FS Clocks */
|
||||
__USB_OTG_FS_CLK_ENABLE();
|
||||
|
||||
|
||||
Loading…
Reference in New Issue
Block a user