4
0
mirror of https://github.com/RT-Thread/rt-thread.git synced 2025-02-20 21:37:22 +08:00

Merge pull request #1184 from uestczyh222/master

[Components][Drivers][USB Device]fix ep assign bug
This commit is contained in:
Bernard Xiong 2018-01-22 15:43:10 +08:00 committed by GitHub
commit 828804e26d
No known key found for this signature in database
GPG Key ID: 4AEE18F83AFDEB23

View File

@ -1845,7 +1845,7 @@ static rt_err_t rt_usbd_ep_assign(udevice_t device, uep_t ep)
while(device->dcd->ep_pool[i].addr != 0xFF)
{
if(device->dcd->ep_pool[i].status == ID_UNASSIGNED &&
ep->ep_desc->bmAttributes == device->dcd->ep_pool[i].type)
ep->ep_desc->bmAttributes == device->dcd->ep_pool[i].type && (EP_ADDRESS(ep) & 0x80) == device->dcd->ep_pool[i].dir)
{
EP_ADDRESS(ep) |= device->dcd->ep_pool[i].addr;
ep->id = &device->dcd->ep_pool[i];