diff options
author | Gregory Nutt <gnutt@nuttx.org> | 2013-09-03 16:24:11 -0600 |
---|---|---|
committer | Gregory Nutt <gnutt@nuttx.org> | 2013-09-03 16:24:11 -0600 |
commit | 2889f96c60fb994474adb825f6e2ac09901c5eda (patch) | |
tree | d8426a8513e14bc3740f137a110907aa2250a03c | |
parent | dceb2d4a91921794ce9277e43c26821816a93135 (diff) | |
download | px4-nuttx-2889f96c60fb994474adb825f6e2ac09901c5eda.tar.gz px4-nuttx-2889f96c60fb994474adb825f6e2ac09901c5eda.tar.bz2 px4-nuttx-2889f96c60fb994474adb825f6e2ac09901c5eda.zip |
SAMA5 UDPHS: Small change to zero length packet handling
-rw-r--r-- | nuttx/arch/arm/src/sama5/sam_udphs.c | 12 |
1 files changed, 9 insertions, 3 deletions
diff --git a/nuttx/arch/arm/src/sama5/sam_udphs.c b/nuttx/arch/arm/src/sama5/sam_udphs.c index 71e3e1941..e87378e69 100644 --- a/nuttx/arch/arm/src/sama5/sam_udphs.c +++ b/nuttx/arch/arm/src/sama5/sam_udphs.c @@ -1395,11 +1395,17 @@ static int sam_req_write(struct sam_usbdev_s *priv, struct sam_ep_s *privep) } } - /* No data to send... is there a trailing zero length packet transfer - * pending? + /* No data to send... This can happen on one of two ways: + * (1) The last packet sent was the final packet of a transfer + * and was exactly maxpacketsize and the protocol expects + * a zero length packet to follow (privep->txnullpkt will be + * set). Or (2) we called with a request packet that has + * len == 0 (privep->txnullpkt will not be set). Either case + * means that it is time to send a NULL packet and complete + * this transfer. */ - else if (privep->txnullpkt) + else { /* If we get here, then we sent the last of the data on the * previous pass and we need to send the zero length packet now. |