diff options
| author | Nathan Conrad <[email protected]> | 2020-04-08 11:51:33 -0400 |
|---|---|---|
| committer | Nathan Conrad <[email protected]> | 2020-04-09 17:03:12 -0400 |
| commit | 715c4dbbf8fe7c6bb83013df626a201928704b30 (patch) | |
| tree | f2379e646562b08cbb099c36956a37594d424dfa /src/device | |
| parent | d6578823bb405cacbda13a044b66ba0a4f16a3d4 (diff) | |
stm32fsdev: Implement dcd_connect.
Diffstat (limited to 'src/device')
| -rw-r--r-- | src/device/dcd.h | 8 | ||||
| -rw-r--r-- | src/device/usbd.c | 1 |
2 files changed, 5 insertions, 4 deletions
diff --git a/src/device/dcd.h b/src/device/dcd.h index 487ddb3b6..f6a8aebbf 100644 --- a/src/device/dcd.h +++ b/src/device/dcd.h @@ -106,11 +106,11 @@ void dcd_set_config (uint8_t rhport, uint8_t config_num); // Wake up host void dcd_remote_wakeup(uint8_t rhport); -// disconnect by disabling internal pull-up resistor on D+/D- -void dcd_disconnect(uint8_t rhport) TU_ATTR_WEAK; - -// connect by enabling internal pull-up resistor on D+/D- +// Connect or disconnect D+/D- line pull-up resistor. +// Defined as weak in dcd source if MCU has internal pull-up. +// Can be strongly defined in BSP. void dcd_connect(uint8_t rhport) TU_ATTR_WEAK; +void dcd_disconnect(uint8_t rhport) TU_ATTR_WEAK; //--------------------------------------------------------------------+ // Endpoint API diff --git a/src/device/usbd.c b/src/device/usbd.c index ddd99d7f1..17a251a92 100644 --- a/src/device/usbd.c +++ b/src/device/usbd.c @@ -332,6 +332,7 @@ bool tud_init (void) // Init device controller driver dcd_init(TUD_OPT_RHPORT); + tud_connect(); dcd_int_enable(TUD_OPT_RHPORT); return true; |
