[Components][Drivers][USB][Core]fix io request

This commit is contained in:
MiraculousConch 2017-11-29 14:25:45 +08:00
parent 596d9b427b
commit c64fa9f059
1 changed files with 5 additions and 1 deletions

View File

@ -840,6 +840,10 @@ static rt_err_t _data_notify(udevice_t device, struct ep_msg* ep_msg)
{
EP_HANDLER(ep, func, ep->request.size);
}
else
{
dcd_ep_read_prepare(device->dcd, EP_ADDRESS(ep), ep->request.buffer, ep->request.remain_size > EP_MAXPACKET(ep) ? EP_MAXPACKET(ep) : ep->request.remain_size);
}
}
return RT_EOK;
@ -973,7 +977,7 @@ static rt_size_t rt_usbd_ep_read_prepare(udevice_t device, uep_t ep, void *buffe
RT_ASSERT(buffer != RT_NULL);
RT_ASSERT(ep->ep_desc != RT_NULL);
return dcd_ep_read_prepare(device->dcd, EP_ADDRESS(ep), buffer, size);
return dcd_ep_read_prepare(device->dcd, EP_ADDRESS(ep), buffer, size > EP_MAXPACKET(ep) ? EP_MAXPACKET(ep) : size);
}
/**