diff options
| author | Nathan Conrad <[email protected]> | 2020-04-10 10:23:56 -0400 |
|---|---|---|
| committer | Nathan Conrad <[email protected]> | 2020-04-10 10:26:41 -0400 |
| commit | 5bd9d14fc14d9130d7d879800bd46e4ca08e3d5f (patch) | |
| tree | 377e0401716f492b5dd29de016ed274f12790655 | |
| parent | 715c4dbbf8fe7c6bb83013df626a201928704b30 (diff) | |
stm32fsdev: set dcd_connect API definitions to strong, Modify documentation.
| -rw-r--r-- | docs/porting.md | 4 | ||||
| -rw-r--r-- | src/device/dcd.h | 4 | ||||
| -rw-r--r-- | src/portable/st/stm32_fsdev/dcd_stm32_fsdev.c | 6 |
3 files changed, 7 insertions, 7 deletions
diff --git a/docs/porting.md b/docs/porting.md index 7d7d4cdb1..d3408aebd 100644 --- a/docs/porting.md +++ b/docs/porting.md @@ -62,7 +62,7 @@ All of the code for the low-level device API is in `src/portable/<vendor>/<chip ##### dcd_init Initializes the USB peripheral for device mode and enables it. -If the MCU has an internal pull-up, this function should leave it disabled. +This function should leave an internal D+/D- pull-up in its default power-on state. `dcd_connect` will be called by the USBD core following `dcd_init`. #### dcd_int_enable / dcd_int_disable @@ -81,7 +81,7 @@ Called to remote wake up host when suspended (e.g hid keyboard) ##### dcd_connect / dcd_disconnect -Connect or disconnect the data-line pull-up resistor. Define as a weak function if the MCU has an internal pull-up, otherwise do not define. +Connect or disconnect the data-line pull-up resistor. Define only if MCU has an internal pull-up. (BSP may define for MCU without internal pull-up.) #### Special events You must let TinyUSB know when certain events occur so that it can continue its work. There are a few methods you can call to queue events for TinyUSB to process. diff --git a/src/device/dcd.h b/src/device/dcd.h index f6a8aebbf..c053229ec 100644 --- a/src/device/dcd.h +++ b/src/device/dcd.h @@ -107,8 +107,8 @@ void dcd_set_config (uint8_t rhport, uint8_t config_num); void dcd_remote_wakeup(uint8_t rhport); // 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. +// Defined in dcd source if MCU has internal pull-up. +// Otherwise, may be defined in BSP. void dcd_connect(uint8_t rhport) TU_ATTR_WEAK; void dcd_disconnect(uint8_t rhport) TU_ATTR_WEAK; diff --git a/src/portable/st/stm32_fsdev/dcd_stm32_fsdev.c b/src/portable/st/stm32_fsdev/dcd_stm32_fsdev.c index b893ec05a..3cd35cca4 100644 --- a/src/portable/st/stm32_fsdev/dcd_stm32_fsdev.c +++ b/src/portable/st/stm32_fsdev/dcd_stm32_fsdev.c @@ -243,17 +243,17 @@ void dcd_init (uint8_t rhport) // Data-line pull-up is left disconnected. } -// Define only on MCU with internal pull-up so BSP can override (needed on MCU without internal pull-up) +// Define only on MCU with internal pull-up. BSP can define on MCU without internal PU. #if defined(USB_BCDR_DPPU) -TU_ATTR_WEAK +// Disable internal D+ PU void dcd_disconnect(uint8_t rhport) { (void) rhport; USB->BCDR &= ~(USB_BCDR_DPPU); } -TU_ATTR_WEAK +// Enable internal D+ PU void dcd_connect(uint8_t rhport) { (void) rhport; |
