diff options
Diffstat (limited to 'nuttx/arch/arm/src/lpc214x/lpc214x_usbdev.c')
-rw-r--r-- | nuttx/arch/arm/src/lpc214x/lpc214x_usbdev.c | 9 |
1 files changed, 6 insertions, 3 deletions
diff --git a/nuttx/arch/arm/src/lpc214x/lpc214x_usbdev.c b/nuttx/arch/arm/src/lpc214x/lpc214x_usbdev.c index de0a5ec0c..cb220cc1b 100644 --- a/nuttx/arch/arm/src/lpc214x/lpc214x_usbdev.c +++ b/nuttx/arch/arm/src/lpc214x/lpc214x_usbdev.c @@ -1062,15 +1062,18 @@ static int lpc214x_wrrequest(struct lpc214x_ep_s *privep) * bytes to send. */ + privep->txnullpkt = 0; if (bytesleft > privep->ep.maxpacket) { nbytes = privep->ep.maxpacket; - privep->txnullpkt = 0; } else { nbytes = bytesleft; - privep->txnullpkt = (bytesleft == privep->ep.maxpacket); + if ((privreq->req.flags & USBDEV_REQFLAGS_NULLPKT) != 0) + { + privep->txnullpkt = (bytesleft == privep->ep.maxpacket); + } } /* Send the largest number of bytes that we can in this packet */ @@ -1087,7 +1090,7 @@ static int lpc214x_wrrequest(struct lpc214x_ep_s *privep) * then we are finished with the transfer */ - if (bytesleft <= 0 || !privep->txnullpkt) + if (bytesleft <= 0 && !privep->txnullpkt) { usbtrace(TRACE_COMPLETE(privep->epphy), privreq->req.xfrd); privep->txnullpkt = 0; |