check for PWR_USBSCR_USB33DEN before enabling USB VDD

This commit is contained in:
hathach 2024-04-02 17:11:22 +07:00
parent 4b993708c9
commit f2859287df
No known key found for this signature in database
GPG Key ID: 26FAB84F615C3C52
4 changed files with 3 additions and 14 deletions

View File

@ -115,10 +115,6 @@ static inline void SystemClock_Config(void) {
__HAL_RCC_USB_CLK_ENABLE();
}
static inline void board_enable_vdd_usb(void) {
// USB in STM32H503RB does not require enabling VDD
}
#ifdef __cplusplus
}
#endif

View File

@ -122,10 +122,6 @@ static inline void SystemClock_Config(void) {
__HAL_RCC_USB_CLK_ENABLE();
}
static inline void board_enable_vdd_usb(void) {
/* Enable VDDUSB to power on USB peripheral */
HAL_PWREx_EnableVddUSB();
}
#ifdef __cplusplus
}
#endif

View File

@ -108,11 +108,6 @@ static inline void SystemClock_Config(void) {
__HAL_RCC_USB_CLK_ENABLE();
}
static inline void board_enable_vdd_usb(void) {
/* Enable VDDUSB to power on USB peripheral */
HAL_PWREx_EnableVddUSB();
}
#ifdef __cplusplus
}
#endif

View File

@ -145,7 +145,9 @@ void board_init(void) {
__HAL_RCC_USB_CLK_ENABLE();
/* Enable VDDUSB */
board_enable_vdd_usb();
#if defined (PWR_USBSCR_USB33DEN)
HAL_PWREx_EnableVddUSB();
#endif
}
//--------------------------------------------------------------------+