only set turnaround in reset complete

This commit is contained in:
hathach 2020-07-01 18:49:58 +07:00
parent e3974d6869
commit d2450abaaf
1 changed files with 1 additions and 6 deletions

View File

@ -417,16 +417,11 @@ void dcd_init (uint8_t rhport)
// Disable external VBUS detection
usb_otg->GUSBCFG &= ~USB_OTG_GUSBCFG_ULPIEVBUSD;
#endif
// Highspeed with external ULPI PHY
set_turnaround(usb_otg, TUSB_SPEED_HIGH);
} else
#endif
{
// Enable internal PHY
usb_otg->GUSBCFG |= USB_OTG_GUSBCFG_PHYSEL;
set_turnaround(usb_otg, TUSB_SPEED_FULL);
}
// Reset core after selecting PHY
@ -457,7 +452,7 @@ void dcd_init (uint8_t rhport)
if ( rhport == 1 )
{
if ( !TUD_OPT_HIGH_SPEED ) dev->DCFG |= ((TUD_OPT_HIGH_SPEED ? DCD_HIGH_SPEED : DCD_FULL_SPEED_USE_HS) << USB_OTG_DCFG_DSPD_Pos);
dev->DCFG |= ((TUD_OPT_HIGH_SPEED ? DCD_HIGH_SPEED : DCD_FULL_SPEED_USE_HS) << USB_OTG_DCFG_DSPD_Pos);
}
else
{