mirror of
https://github.com/apache/nuttx.git
synced 2026-06-05 07:12:54 +08:00
arch/{nrf52|nrf53}/usbd: fix IN endpoint completion logic
Confirmation of the IN request must be done immediately after all data has been transferred, otherwise sending data when more than one request has been added to the queue will not work properly.
This commit is contained in:
@@ -1143,7 +1143,9 @@ static void nrf52_epin_request(struct nrf52_usbdev_s *priv,
|
|||||||
privreq->req.xfrd += nbytes;
|
privreq->req.xfrd += nbytes;
|
||||||
}
|
}
|
||||||
|
|
||||||
else if (privreq->req.xfrd >= privreq->req.len)
|
/* Has all the request data been sent? */
|
||||||
|
|
||||||
|
if (privreq->req.xfrd >= privreq->req.len)
|
||||||
{
|
{
|
||||||
usbtrace(TRACE_COMPLETE(privep->epphy), privreq->req.xfrd);
|
usbtrace(TRACE_COMPLETE(privep->epphy), privreq->req.xfrd);
|
||||||
|
|
||||||
|
|||||||
@@ -1143,7 +1143,9 @@ static void nrf53_epin_request(struct nrf53_usbdev_s *priv,
|
|||||||
privreq->req.xfrd += nbytes;
|
privreq->req.xfrd += nbytes;
|
||||||
}
|
}
|
||||||
|
|
||||||
else if (privreq->req.xfrd >= privreq->req.len)
|
/* Has all the request data been sent? */
|
||||||
|
|
||||||
|
if (privreq->req.xfrd >= privreq->req.len)
|
||||||
{
|
{
|
||||||
usbtrace(TRACE_COMPLETE(privep->epphy), privreq->req.xfrd);
|
usbtrace(TRACE_COMPLETE(privep->epphy), privreq->req.xfrd);
|
||||||
|
|
||||||
|
|||||||
Reference in New Issue
Block a user