File tree 1 file changed +6
-0
lines changed
1 file changed +6
-0
lines changed Original file line number Diff line number Diff line change @@ -193,12 +193,18 @@ WEAK void USBD_reenumerate(void)
193
193
digitalWriteFast (USBD_PULLUP_CONTROL_PINNAME , USBD_ATTACH_LEVEL );
194
194
#endif /* defined(USBD_PULLUP_CONTROL_FLOATING) */
195
195
#elif defined(USBD_HAVE_INTERNAL_PULLUPS )
196
+ #ifdef USB_OTG_DCTL_SDIS
196
197
uint32_t USBx_BASE = (uint32_t )USBD_USB_INSTANCE ;
197
198
USBx_DEVICE -> DCTL |= USB_OTG_DCTL_SDIS ;
198
199
//USB_DevDisconnect(USBD_USB_INSTANCE);
199
200
USBD_early_startup_delay_us (USBD_ENUM_DELAY * 1000 );
200
201
//USB_DevConnect(USBD_USB_INSTANCE);
201
202
USBx_DEVICE -> DCTL &= ~USB_OTG_DCTL_SDIS ;
203
+ #else
204
+ USBD_USB_INSTANCE -> BCDR &= (uint16_t )(~(USB_BCDR_DPPU ));
205
+ USBD_early_startup_delay_us (USBD_ENUM_DELAY * 1000 );
206
+ USBD_USB_INSTANCE -> BCDR |= (uint16_t )(USB_BCDR_DPPU );
207
+ #endif
202
208
#else
203
209
#warning "No USB attach/detach method, USB might not be reliable through system resets"
204
210
#endif
You can’t perform that action at this time.
0 commit comments