File tree Expand file tree Collapse file tree 1 file changed +6
-0
lines changed Expand file tree Collapse file tree 1 file changed +6
-0
lines changed Original file line number Diff line number Diff line change @@ -194,12 +194,18 @@ WEAK void USBD_reenumerate(void)
194194 digitalWriteFast (USBD_PULLUP_CONTROL_PINNAME , USBD_ATTACH_LEVEL );
195195#endif /* defined(USBD_PULLUP_CONTROL_FLOATING) */
196196#elif defined(USBD_HAVE_INTERNAL_PULLUPS )
197+ #ifdef USB_OTG_DCTL_SDIS
197198 uint32_t USBx_BASE = (uint32_t )USBD_USB_INSTANCE ;
198199 USBx_DEVICE -> DCTL |= USB_OTG_DCTL_SDIS ;
199200 //USB_DevDisconnect(USBD_USB_INSTANCE);
200201 USBD_early_startup_delay_us (USBD_ENUM_DELAY * 1000 );
201202 //USB_DevConnect(USBD_USB_INSTANCE);
202203 USBx_DEVICE -> DCTL &= ~USB_OTG_DCTL_SDIS ;
204+ #else
205+ USBD_USB_INSTANCE -> BCDR &= (uint16_t )(~(USB_BCDR_DPPU ));
206+ USBD_early_startup_delay_us (USBD_ENUM_DELAY * 1000 );
207+ USBD_USB_INSTANCE -> BCDR |= (uint16_t )(USB_BCDR_DPPU );
208+ #endif
203209#else
204210#warning "No USB attach/detach method, USB might not be reliable through system resets"
205211#endif
You can’t perform that action at this time.
0 commit comments