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 @@ -194,12 +194,18 @@ WEAK void USBD_reenumerate(void)
194
194
digitalWriteFast (USBD_PULLUP_CONTROL_PINNAME , USBD_ATTACH_LEVEL );
195
195
#endif /* defined(USBD_PULLUP_CONTROL_FLOATING) */
196
196
#elif defined(USBD_HAVE_INTERNAL_PULLUPS )
197
+ #ifdef USB_OTG_DCTL_SDIS
197
198
uint32_t USBx_BASE = (uint32_t )USBD_USB_INSTANCE ;
198
199
USBx_DEVICE -> DCTL |= USB_OTG_DCTL_SDIS ;
199
200
//USB_DevDisconnect(USBD_USB_INSTANCE);
200
201
USBD_early_startup_delay_us (USBD_ENUM_DELAY * 1000 );
201
202
//USB_DevConnect(USBD_USB_INSTANCE);
202
203
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
203
209
#else
204
210
#warning "No USB attach/detach method, USB might not be reliable through system resets"
205
211
#endif
You can’t perform that action at this time.
0 commit comments