aboutsummaryrefslogtreecommitdiff
path: root/nuttx/arch
diff options
context:
space:
mode:
authorpatacongo <patacongo@7fd9a85b-ad96-42d3-883c-3090e2eb8679>2012-04-11 17:13:04 +0000
committerpatacongo <patacongo@7fd9a85b-ad96-42d3-883c-3090e2eb8679>2012-04-11 17:13:04 +0000
commit0c9433d03263676a6c9142b195f86b0065bfe856 (patch)
treee6ebf397e8ec882c2ce2c0c5221d463c0a5bee5b /nuttx/arch
parentd334d4d0153973bab43e156f8c5326c5084bdd6f (diff)
downloadpx4-firmware-0c9433d03263676a6c9142b195f86b0065bfe856.tar.gz
px4-firmware-0c9433d03263676a6c9142b195f86b0065bfe856.tar.bz2
px4-firmware-0c9433d03263676a6c9142b195f86b0065bfe856.zip
Misc STM32 OTF FS driver fixes + More Kconfig files
git-svn-id: https://nuttx.svn.sourceforge.net/svnroot/nuttx/trunk@4590 7fd9a85b-ad96-42d3-883c-3090e2eb8679
Diffstat (limited to 'nuttx/arch')
-rwxr-xr-xnuttx/arch/arm/src/stm32/stm32_otgfsdev.c16
1 files changed, 13 insertions, 3 deletions
diff --git a/nuttx/arch/arm/src/stm32/stm32_otgfsdev.c b/nuttx/arch/arm/src/stm32/stm32_otgfsdev.c
index 587dd4bca..2f297d09f 100755
--- a/nuttx/arch/arm/src/stm32/stm32_otgfsdev.c
+++ b/nuttx/arch/arm/src/stm32/stm32_otgfsdev.c
@@ -1020,6 +1020,16 @@ static void stm32_epin_request(FAR struct stm32_usbdev_s *priv,
privep->epphy, privreq, privreq->req.len,
privreq->req.xfrd, privep->zlp);
+ /* Check for a special case: If we are just starting a request (xfrd==0) and
+ * the class driver is trying to send a zero-length packet (len==0). Then set
+ * the ZLP flag so that the packet will be sent.
+ */
+
+ if (privreq->req.len == 0)
+ {
+ privep->zlp = true;
+ }
+
/* Loop while there are still bytes to be transferred (or a zero-length-
* packet, ZLP, to be sent). The loop will also be terminated if there
* is insufficient space remaining in the TxFIFO to send a complete
@@ -1043,7 +1053,7 @@ static void stm32_epin_request(FAR struct stm32_usbdev_s *priv,
* the request.
*/
- privep->zlp = 0;
+ privep->zlp = false;
if (nbytes >= privep->ep.maxpacket)
{
nbytes = privep->ep.maxpacket;
@@ -1056,7 +1066,7 @@ static void stm32_epin_request(FAR struct stm32_usbdev_s *priv,
if (bytesleft == privep->ep.maxpacket &&
(privreq->req.flags & USBDEV_REQFLAGS_NULLPKT) != 0)
{
- privep->zlp = 1;
+ privep->zlp = true;
}
}
}
@@ -1127,7 +1137,7 @@ static void stm32_epin_request(FAR struct stm32_usbdev_s *priv,
usbtrace(TRACE_COMPLETE(privep->epphy), privreq->req.xfrd);
stm32_req_complete(privep, OK);
- privep->zlp = 0;
+ privep->zlp = false;
privep->active = false;
}
}