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:
raiden00pl 2023-05-26 14:16:58 +02:00 committed by Xiang Xiao
parent 5f5ffa9380
commit 20af03b31e
2 changed files with 6 additions and 2 deletions

View File

@ -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);

View File

@ -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);