summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorpatacongo <patacongo@42af7a65-404d-4744-a932-0658087f49c3>2011-03-11 20:16:17 +0000
committerpatacongo <patacongo@42af7a65-404d-4744-a932-0658087f49c3>2011-03-11 20:16:17 +0000
commitdf9cb3ba59cdd40da994ff9ab6b153ef12875d9e (patch)
tree471c2407efefc9c4489c365c2cd55b162f8bf0c8
parent1924debc29cbc64094cf41bbdf878c6c53dd4d7b (diff)
downloadnuttx-df9cb3ba59cdd40da994ff9ab6b153ef12875d9e.tar.gz
nuttx-df9cb3ba59cdd40da994ff9ab6b153ef12875d9e.tar.bz2
nuttx-df9cb3ba59cdd40da994ff9ab6b153ef12875d9e.zip
Fix nsh/apps bug
git-svn-id: svn://svn.code.sf.net/p/nuttx/code/trunk@3367 42af7a65-404d-4744-a932-0658087f49c3
-rw-r--r--nuttx/ChangeLog7
-rw-r--r--nuttx/Documentation/NuttX.html9
-rw-r--r--nuttx/examples/nsh/nsh_main.c12
3 files changed, 24 insertions, 4 deletions
diff --git a/nuttx/ChangeLog b/nuttx/ChangeLog
index 5ad653a30..0306a28de 100644
--- a/nuttx/ChangeLog
+++ b/nuttx/ChangeLog
@@ -1535,3 +1535,10 @@
* drivers/uart_16550.c and include/nuttx/uart_16550.h - Support for a generic
16550 UART.
* configure/qemu-i486/nsh - QEMU NSH example.
+ * ../apps - The apps directory add-on was created by Uros Platise. It
+ supports a set of end-user applications than can be executed on top of
+ NSH. Think of it this way: In a buckled-up embedded application, your
+ end-user programs will probably have their own dedicated start-up logic.
+ But, during development, you might want to have you applications
+ available and executable from the NSH command line. This apps/ addon
+ (and NSH hooks) was contributed by Uros to accomplish just that.
diff --git a/nuttx/Documentation/NuttX.html b/nuttx/Documentation/NuttX.html
index 38e62ec95..a3763dcef 100644
--- a/nuttx/Documentation/NuttX.html
+++ b/nuttx/Documentation/NuttX.html
@@ -8,7 +8,7 @@
<tr align="center" bgcolor="#e4e4e4">
<td>
<h1><big><font color="#3c34ec"><i>NuttX RTOS</i></font></big></h1>
- <p>Last Updated: March 9, 2011</p>
+ <p>Last Updated: March 11, 2011</p>
</td>
</tr>
</table>
@@ -2159,6 +2159,13 @@ nuttx-5.19 2011-xx-xx Gregory Nutt &lt;spudmonkey@racsa.co.cr&gt;
* drivers/uart_16550.c and include/nuttx/uart_16550.h - Support for a generic
16550 UART.
* configure/qemu-i486/nsh - QEMU NSH example.
+ * ../apps - The apps directory add-on was created by Uros Platise. It
+ supports a set of end-user applications than can be executed on top of
+ NSH. Think of it this way: In a buckled-up embedded application, your
+ end-user programs will probably have their own dedicated start-up logic.
+ But, during development, you might want to have you applications
+ available and executable from the NSH command line. This apps/ addon
+ (and NSH hooks) was contributed by Uros to accomplish just that.
pascal-2.1 2011-xx-xx Gregory Nutt &lt;spudmonkey@racsa.co.cr&gt;
diff --git a/nuttx/examples/nsh/nsh_main.c b/nuttx/examples/nsh/nsh_main.c
index 680267e43..f9a34f0a1 100644
--- a/nuttx/examples/nsh/nsh_main.c
+++ b/nuttx/examples/nsh/nsh_main.c
@@ -492,12 +492,18 @@ static int nsh_execute(FAR struct nsh_vtbl_s *vtbl, int argc, char *argv[])
}
}
+ /* If the command was not found, then try to execute the command from
+ * a list of pre-built applications.
+ */
+
#ifdef CONFIG_EXAMPLES_NSH_BUILTIN_APPS
- if (handler == cmd_unrecognized)
+ if (handler == cmd_unrecognized && nsh_execapp(vtbl, cmd, argv) == OK)
{
- /* Try to execute the command from a list of pre-built applications. */
+ /* The pre-built application was successfully started -- run OK.
+ * If not, then fall through to execute the cmd_nrecognized handler.
+ */
- return nsh_execapp(vtbl, cmd, argv);
+ return OK;
}
#endif