git-svn-id: svn://svn.code.sf.net/p/chibios/svn/trunk@12471 110e8d01-0319-4d1e-a829-52ad28d1bb01
This commit is contained in:
gdisirio 2018-12-16 07:52:19 +00:00
parent f20ecc7817
commit b79f097e36
1 changed files with 4 additions and 2 deletions

View File

@ -134,7 +134,9 @@ static const stm32_otg_params_t hsparams = {
static void otg_core_reset(USBDriver *usbp) {
stm32_otg_t *otgp = usbp->otg;
osalSysPolledDelayX(32);
/* Wait AHB idle condition.*/
while ((otgp->GRSTCTL & GRSTCTL_AHBIDL) == 0)
;
/* Core reset and delay of at least 3 PHY cycles.*/
otgp->GRSTCTL = GRSTCTL_CSRST;
@ -143,7 +145,7 @@ static void otg_core_reset(USBDriver *usbp) {
osalSysPolledDelayX(18);
/* Wait AHB idle condition.*/
/* Wait AHB idle condition again.*/
while ((otgp->GRSTCTL & GRSTCTL_AHBIDL) == 0)
;
}