Skip to content

Commit 3b0c9f5

Browse files
[USB] Disable USB pullup hack when internal pullups are available
Previously, when no external pullup control was available, the core would apply a hack to override an external fixed pullup. However, on chips that have internal pullups, these will be automatically controlled, so this is not needed at all. This probably needs to be more configurable by board, but this is enough to for the specific board we are working with now. See stm32duino#885
1 parent 6bdbea4 commit 3b0c9f5

File tree

1 file changed

+4
-0
lines changed

1 file changed

+4
-0
lines changed

cores/arduino/stm32/usb/usbd_if.c

+4
Original file line numberDiff line numberDiff line change
@@ -18,6 +18,9 @@
1818

1919
WEAK void USBD_reenumerate(void)
2020
{
21+
// If SDIS (soft disconnect) is enabled, assume there are internal
22+
// pullups which will be managed automatically, so do nothing.
23+
#ifndef USB_OTG_DCTL_SDIS
2124
#ifndef USBD_REENUM_DISABLED
2225
/* Re-enumerate the USB */
2326
#ifdef USB_DISC_PIN
@@ -38,6 +41,7 @@ WEAK void USBD_reenumerate(void)
3841
/*delay(USBD_ENUM_DELAY);*/
3942
#endif /* USB_DISC_PIN */
4043
#endif /* USBD_REENUM_DISABLED */
44+
#endif /* USB_OTG_DCTL_SDIS */
4145
}
4246

4347
#ifdef USBD_USE_CDC

0 commit comments

Comments
 (0)