summaryrefslogtreecommitdiff
path: root/src/portable/st
diff options
context:
space:
mode:
authorhathach <[email protected]>2020-08-01 20:14:58 +0700
committerhathach <[email protected]>2020-08-01 20:14:58 +0700
commitacde49ccc97466f603dc7face7ab70ea10d38ee3 (patch)
tree39faa19822bd0a3fee11bf3d6e05aa3157f70fe4 /src/portable/st
parent310797a58073dbd6d56eb4c85afd354949ce6630 (diff)
enable pull-up in dcd_init() instead of usbd
Diffstat (limited to 'src/portable/st')
-rw-r--r--src/portable/st/stm32_fsdev/dcd_stm32_fsdev.c4
-rw-r--r--src/portable/st/synopsys/dcd_synopsys.c2
2 files changed, 4 insertions, 2 deletions
diff --git a/src/portable/st/stm32_fsdev/dcd_stm32_fsdev.c b/src/portable/st/stm32_fsdev/dcd_stm32_fsdev.c
index da184abe7..32179874e 100644
--- a/src/portable/st/stm32_fsdev/dcd_stm32_fsdev.c
+++ b/src/portable/st/stm32_fsdev/dcd_stm32_fsdev.c
@@ -205,7 +205,6 @@ static inline void reg16_clear_bits(__IO uint16_t *reg, uint16_t mask) {
void dcd_init (uint8_t rhport)
{
- (void)rhport;
/* Clocks should already be enabled */
/* Use __HAL_RCC_USB_CLK_ENABLE(); to enable the clocks before calling this function */
@@ -244,7 +243,8 @@ void dcd_init (uint8_t rhport)
USB->CNTR |= USB_CNTR_RESETM | (USE_SOF ? USB_CNTR_SOFM : 0) | USB_CNTR_ESOFM | USB_CNTR_CTRM | USB_CNTR_SUSPM | USB_CNTR_WKUPM;
dcd_handle_bus_reset();
- // Data-line pull-up is left disconnected.
+ // Enable pull-up if supported
+ if ( dcd_connect ) dcd_connect(rhport);
}
// Define only on MCU with internal pull-up. BSP can define on MCU without internal PU.
diff --git a/src/portable/st/synopsys/dcd_synopsys.c b/src/portable/st/synopsys/dcd_synopsys.c
index f4430f582..a284c0384 100644
--- a/src/portable/st/synopsys/dcd_synopsys.c
+++ b/src/portable/st/synopsys/dcd_synopsys.c
@@ -453,6 +453,8 @@ void dcd_init (uint8_t rhport)
// Enable global interrupt
usb_otg->GAHBCFG |= USB_OTG_GAHBCFG_GINT;
+
+ dcd_connect(rhport);
}
void dcd_int_enable (uint8_t rhport)