summaryrefslogtreecommitdiff
path: root/src
diff options
context:
space:
mode:
authorUwe Bonnes <[email protected]>2020-07-01 23:07:18 +0200
committerUwe Bonnes <[email protected]>2020-07-03 10:52:57 +0200
commitfd3817818921981aa67e1fb845f926c010444fea (patch)
treedbe11ce164d1be710829bff4c6bcb21acec1e86b /src
parent4cec866994f32f729844d0159e14c178f5aa904f (diff)
STM32/OTG_HS: Allow OTG_HS port to run at FS speed.
Add "REDUCE_SPEED=1" to the compile options.
Diffstat (limited to 'src')
-rw-r--r--src/portable/st/synopsys/dcd_synopsys.c8
1 files changed, 3 insertions, 5 deletions
diff --git a/src/portable/st/synopsys/dcd_synopsys.c b/src/portable/st/synopsys/dcd_synopsys.c
index 50984c830..6c3a10b00 100644
--- a/src/portable/st/synopsys/dcd_synopsys.c
+++ b/src/portable/st/synopsys/dcd_synopsys.c
@@ -312,7 +312,8 @@ static void set_speed(uint8_t rhport, tusb_speed_t speed)
dev->DCFG |= (bitvalue << USB_OTG_DCFG_DSPD_Pos);
}
-#if defined(USB_HS_PHYC) && TUD_OPT_HIGH_SPEED
+
+#if defined(USB_HS_PHYC)
static bool USB_HS_PHYCInit(void)
{
USB_HS_PHYC_GlobalTypeDef *usb_hs_phyc = (USB_HS_PHYC_GlobalTypeDef*) USB_HS_PHYC_CONTROLLER_BASE;
@@ -398,7 +399,6 @@ void dcd_init (uint8_t rhport)
USB_OTG_GlobalTypeDef * usb_otg = GLOBAL_BASE(rhport);
// No HNP/SRP (no OTG support), program timeout later.
-#if TUD_OPT_HIGH_SPEED // TODO may pass parameter instead of using macro for HighSpeed
if ( rhport == 1 )
{
// On selected MCUs HS port1 can be used with external PHY via ULPI interface
@@ -421,10 +421,8 @@ void dcd_init (uint8_t rhport)
// Enables control of a High Speed USB PHY
USB_HS_PHYCInit();
- #endif
- }
- else
#endif
+ } else
{
// Enable internal PHY
usb_otg->GUSBCFG |= USB_OTG_GUSBCFG_PHYSEL;