summaryrefslogtreecommitdiff
path: root/src
diff options
context:
space:
mode:
authorJacob Potter <[email protected]>2020-10-24 17:11:32 -0600
committerJacob Potter <[email protected]>2020-10-24 17:11:32 -0600
commit01996457c8974de5fcb02dab32210ddb99f0134a (patch)
treec503d76387725cb956f065c6b5667b5e7ca83fef /src
parentc87ed8eff1ac1305f69dd83144890f5a6f752a6f (diff)
CR feedback: compare CFG_TUSB_RHPORT1_MODE instead of using new macro
Diffstat (limited to 'src')
-rw-r--r--src/portable/st/synopsys/dcd_synopsys.c14
1 files changed, 7 insertions, 7 deletions
diff --git a/src/portable/st/synopsys/dcd_synopsys.c b/src/portable/st/synopsys/dcd_synopsys.c
index 11678857c..6edb119c1 100644
--- a/src/portable/st/synopsys/dcd_synopsys.c
+++ b/src/portable/st/synopsys/dcd_synopsys.c
@@ -416,9 +416,7 @@ void dcd_init (uint8_t rhport)
if ( rhport == 1 )
{
// On selected MCUs HS port1 can be used with external PHY via ULPI interface
-#if defined(TUD_OPT_SYNOPSYS_FS_PHY)
- usb_otg->GUSBCFG |= USB_OTG_GUSBCFG_PHYSEL;
-#else
+#if CFG_TUSB_RHPORT1_MODE & OPT_MODE_HIGH_SPEED
// deactivate internal PHY
usb_otg->GCCFG &= ~USB_OTG_GCCFG_PWRDWN;
@@ -427,6 +425,8 @@ void dcd_init (uint8_t rhport)
// Select default internal VBUS Indicator and Drive for ULPI
usb_otg->GUSBCFG &= ~(USB_OTG_GUSBCFG_ULPIEVBUSD | USB_OTG_GUSBCFG_ULPIEVBUSI);
+#else
+ usb_otg->GUSBCFG |= USB_OTG_GUSBCFG_PHYSEL;
#endif
#if defined(USB_HS_PHYC)
@@ -470,11 +470,11 @@ void dcd_init (uint8_t rhport)
set_speed(rhport, TUD_OPT_HIGH_SPEED ? TUSB_SPEED_HIGH : TUSB_SPEED_FULL);
- // Enable internal USB transceiver. Unconditional if using FS PHY on HS core.
-#if defined(TUD_OPT_SYNOPSYS_FS_PHY)
- usb_otg->GCCFG |= USB_OTG_GCCFG_PWRDWN;
-#else
+ // Enable internal USB transceiver, unless using HS core (port 1) with external PHY.
+#if CFG_TUSB_RHPORT1_MODE & OPT_MODE_HIGH_SPEED
if ( rhport == 0 ) usb_otg->GCCFG |= USB_OTG_GCCFG_PWRDWN;
+#else
+ usb_otg->GCCFG |= USB_OTG_GCCFG_PWRDWN;
#endif