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)
5757 pinMode (PIN_UCPD_TCPP , OUTPUT_OPEN_DRAIN );
5858 digitalWriteFast (digitalPinToPinName (PIN_UCPD_TCPP ), LOW );
5959#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
6168#if defined(PWR_CR2_USV ) || defined(PWR_SVMCR_USV ) || defined(PWR_USBSCR_USB33SV )
62- /* Enable VDDUSB on Pwrctrl CR2 register */
69+ /* Enable VDDUSB */
6370 HAL_PWREx_EnableVddUSB ();
6471#endif
65- #ifdef STM32H7xx
66- if (!LL_PWR_IsActiveFlag_USB ()) {
67- HAL_PWREx_EnableUSBVoltageDetector ();
68- }
69- #endif
7072#if defined (USB )
7173 if (hpcd -> Instance == USB ) {
7274
You can’t perform that action at this time.
0 commit comments