synopsys clear DAD on bus_reset

This commit is contained in:
hathach 2021-08-14 01:51:13 +07:00
parent 0ec794376b
commit 6af1950c8d
No known key found for this signature in database
GPG Key ID: 2FA891220FBFD581
1 changed files with 4 additions and 0 deletions

View File

@ -192,6 +192,10 @@ static void bus_reset(uint8_t rhport)
out_ep[n].DOEPCTL |= USB_OTG_DOEPCTL_SNAK;
}
// clear device address
dev->DCFG &= ~USB_OTG_DCFG_DAD_Msk;
// TODO should probably assign value when reset rather than OR
dev->DAINTMSK |= (1 << USB_OTG_DAINTMSK_OEPM_Pos) | (1 << USB_OTG_DAINTMSK_IEPM_Pos);
dev->DOEPMSK |= USB_OTG_DOEPMSK_STUPM | USB_OTG_DOEPMSK_XFRCM;
dev->DIEPMSK |= USB_OTG_DIEPMSK_TOM | USB_OTG_DIEPMSK_XFRCM;