CR feedback: compare CFG_TUSB_RHPORT1_MODE instead of using new macro

This commit is contained in:
Jacob Potter 2020-10-24 17:11:32 -06:00
parent c87ed8eff1
commit 01996457c8
1 changed files with 7 additions and 7 deletions

View File

@ -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