File tree Expand file tree Collapse file tree 3 files changed +9
-2
lines changed Expand file tree Collapse file tree 3 files changed +9
-2
lines changed Original file line number Diff line number Diff line change 8686 #endif
8787#endif
8888
89- /* STM32G0xx defined USB_DRD_FS */
89+ /* STM32G0xx and some STM32U5xx defined USB_DRD_FS */
9090#if !defined(USB ) && defined(USB_DRD_FS )
9191 #define USB USB_DRD_FS
9292 #define PinMap_USB PinMap_USB_DRD_FS
93+ #if defined(STM32U5xx )
94+ #define USB_BASE USB_DRD_BASE
95+ #define __HAL_RCC_USB_CLK_ENABLE __HAL_RCC_USB_FS_CLK_ENABLE
96+ #define __HAL_RCC_USB_CLK_DISABLE __HAL_RCC_USB_FS_CLK_DISABLE
97+ #endif
9398#endif
9499
95100/**
Original file line number Diff line number Diff line change @@ -105,7 +105,9 @@ void HAL_PCD_MspInit(PCD_HandleTypeDef *hpcd)
105105#ifdef __HAL_USB_WAKEUP_EXTI_ENABLE_RISING_EDGE
106106 __HAL_USB_WAKEUP_EXTI_ENABLE_RISING_EDGE ();
107107#endif
108+ #ifdef __HAL_USB_WAKEUP_EXTI_ENABLE_IT
108109 __HAL_USB_WAKEUP_EXTI_ENABLE_IT ();
110+ #endif
109111#if defined(USB_WKUP_IRQn )
110112 /* USB Wakeup Interrupt */
111113 HAL_NVIC_EnableIRQ (USB_WKUP_IRQn );
Original file line number Diff line number Diff line change @@ -74,7 +74,7 @@ extern "C" {
7474#elif defined(STM32G0xx )
7575#define USB_IRQn USB_UCPD1_2_IRQn
7676#define USB_IRQHandler USB_UCPD1_2_IRQHandler
77- #elif defined(STM32U5xx )
77+ #elif defined(STM32U5xx ) && !defined( USB_DRD_FS )
7878#define USB_IRQn OTG_FS_IRQn
7979#define USB_IRQHandler OTG_FS_IRQHandler
8080#elif defined(STM32L5xx )
You can’t perform that action at this time.
0 commit comments