Skip to content

Commit

Permalink
Fix USBD issue
Browse files Browse the repository at this point in the history
Solve the issue that the transmission length is a multiple of max.packet size.

Change-Id: I88fe2574103d19945441ce928d523ef9ab6474e1
  • Loading branch information
hpchen0 committed Apr 29, 2024
1 parent 480f943 commit aa146d4
Showing 1 changed file with 1 addition and 1 deletion.
2 changes: 1 addition & 1 deletion drivers/usb/gadget/udc/nuc980_udc.c
Original file line number Diff line number Diff line change
Expand Up @@ -255,7 +255,7 @@ static int write_fifo(struct nuc980_ep *ep, struct nuc980_request *req)
len = write_packet(ep, req);

/* last packet is often short (sometimes a zlp) */
if (req->req.length == req->req.actual/* && !req->req.zero*/)
if (((req->req.length == req->req.actual) && (len % ep->ep.maxpacket)) || (len == 0))
{
done(ep, req, 0);
return 1;
Expand Down

0 comments on commit aa146d4

Please sign in to comment.