File tree Expand file tree Collapse file tree 1 file changed +9
-7
lines changed Expand file tree Collapse file tree 1 file changed +9
-7
lines changed Original file line number Diff line number Diff line change @@ -57,16 +57,18 @@ void HAL_PCD_MspInit(PCD_HandleTypeDef *hpcd)
57
57
pinMode (PIN_UCPD_TCPP , OUTPUT_OPEN_DRAIN );
58
58
digitalWriteFast (digitalPinToPinName (PIN_UCPD_TCPP ), LOW );
59
59
#endif
60
-
60
+ #if defined(PWR_CR3_USB33DEN ) || defined(PWR_USBSCR_USB33DEN )
61
+ HAL_PWREx_EnableUSBVoltageDetector ();
62
+ #endif
63
+ #if defined(PWR_CR3_USB33RDY )
64
+ while (!LL_PWR_IsActiveFlag_USB ());
65
+ #elif defined(PWR_VMSR_USB33RDY )
66
+ while (!LL_PWR_IsActiveFlag_VDDUSB ());
67
+ #endif
61
68
#if defined(PWR_CR2_USV ) || defined(PWR_SVMCR_USV ) || defined(PWR_USBSCR_USB33SV )
62
- /* Enable VDDUSB on Pwrctrl CR2 register */
69
+ /* Enable VDDUSB */
63
70
HAL_PWREx_EnableVddUSB ();
64
71
#endif
65
- #ifdef STM32H7xx
66
- if (!LL_PWR_IsActiveFlag_USB ()) {
67
- HAL_PWREx_EnableUSBVoltageDetector ();
68
- }
69
- #endif
70
72
#if defined (USB )
71
73
if (hpcd -> Instance == USB ) {
72
74
You can’t perform that action at this time.
0 commit comments