summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
-rw-r--r--nuttx/ChangeLog2
-rw-r--r--nuttx/arch/arm/src/sam34/sam_udp.c1
-rw-r--r--nuttx/arch/arm/src/sama5/sam_udphs.c1
-rw-r--r--nuttx/tools/README.txt8
-rwxr-xr-xnuttx/tools/astyle.sh43
-rwxr-xr-xnuttx/tools/indent.sh2
6 files changed, 56 insertions, 1 deletions
diff --git a/nuttx/ChangeLog b/nuttx/ChangeLog
index fa6fdd153..c603f0013 100644
--- a/nuttx/ChangeLog
+++ b/nuttx/ChangeLog
@@ -7044,4 +7044,6 @@
the task that started in (other than knowing it as the parent). This
allows me to remove so kludge logic to "deparent" the pthread on
startup (2014-3-25).
+ * tools/astyle.sh: A code formatting tool from Lorenz Meier. This
+ tool should do a better job than the old tools/indent.sh tool.
diff --git a/nuttx/arch/arm/src/sam34/sam_udp.c b/nuttx/arch/arm/src/sam34/sam_udp.c
index 6cf8f5cc3..acb0657e2 100644
--- a/nuttx/arch/arm/src/sam34/sam_udp.c
+++ b/nuttx/arch/arm/src/sam34/sam_udp.c
@@ -3082,6 +3082,7 @@ static int sam_ep_submit(struct usbdev_ep_s *ep, struct usbdev_req_s *req)
epno = USB_EPNO(ep->eplog);
req->result = -EINPROGRESS;
req->xfrd = 0;
+ privreq->inflight = 0;
flags = irqsave();
/* Handle IN (device-to-host) requests. NOTE: If the class device is
diff --git a/nuttx/arch/arm/src/sama5/sam_udphs.c b/nuttx/arch/arm/src/sama5/sam_udphs.c
index 8f324ac1a..d71abc82c 100644
--- a/nuttx/arch/arm/src/sama5/sam_udphs.c
+++ b/nuttx/arch/arm/src/sama5/sam_udphs.c
@@ -3575,6 +3575,7 @@ static int sam_ep_submit(struct usbdev_ep_s *ep, struct usbdev_req_s *req)
epno = USB_EPNO(ep->eplog);
req->result = -EINPROGRESS;
req->xfrd = 0;
+ privreq->inflight = 0;
flags = irqsave();
/* Handle IN (device-to-host) requests. NOTE: If the class device is
diff --git a/nuttx/tools/README.txt b/nuttx/tools/README.txt
index a1bf40b60..f0feff661 100644
--- a/nuttx/tools/README.txt
+++ b/nuttx/tools/README.txt
@@ -12,6 +12,12 @@ README.txt
This file!
+astyle.sh
+---------
+
+ A C formatting tool from Lorenz Meier. This is based on astyle and gets
+ very close to the NuttX coding style.
+
Config.mk
---------
@@ -528,6 +534,8 @@ indent.sh
to my coding NuttX coding style. It doesn't do a really good job,
however (see the comments at the top of the indent.sh file).
+ See astyle.sh above. I suspect that it will do a better job.
+
zipme.sh
--------
diff --git a/nuttx/tools/astyle.sh b/nuttx/tools/astyle.sh
new file mode 100755
index 000000000..9b5cc0c0f
--- /dev/null
+++ b/nuttx/tools/astyle.sh
@@ -0,0 +1,43 @@
+#!/bin/sh
+############################################################################
+# tools/astyle.sh
+#
+# Copyright (C) 2014 Gregory Nutt. All rights reserved.
+# Author: Lorenz Meier
+#
+# Redistribution and use in source and binary forms, with or without
+# modification, are permitted provided that the following conditions
+# are met:
+#
+# 1. Redistributions of source code must retain the above copyright
+# notice, this list of conditions and the following disclaimer.
+# 2. Redistributions in binary form must reproduce the above copyright
+# notice, this list of conditions and the following disclaimer in
+# the documentation and/or other materials provided with the
+# distribution.
+# 3. Neither the name NuttX nor the names of its contributors may be
+# used to endorse or promote products derived from this software
+# without specific prior written permission.
+#
+# THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS
+# "AS IS" AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT
+# LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS
+# FOR A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE
+# COPYRIGHT OWNER OR CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT,
+# INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING,
+# BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS
+# OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED
+# AND ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT
+# LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN
+# ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE
+# POSSIBILITY OF SUCH DAMAGE.
+#
+############################################################################
+
+astyle \
+ --style=gnu \
+ --indent=spaces=2 \
+ --indent-cases \
+ --indent-switches \
+ $*
+
diff --git a/nuttx/tools/indent.sh b/nuttx/tools/indent.sh
index 4ebae9652..866430e7e 100755
--- a/nuttx/tools/indent.sh
+++ b/nuttx/tools/indent.sh
@@ -41,7 +41,7 @@
# - I usually align things vertically (like '=' in assignments),
# - indent puts a bogus blank line at the top of the file,
# - I don't like the way it handles nested conditional compilation intermixed with code.
-# - I also indent brackets differently on structures than does not script.
+# - I also indent brackets differently on structures than does this script.
#
# Constants