From f69bf78abb1dfe86907aa600ed33705a155ef206 Mon Sep 17 00:00:00 2001 From: patacongo Date: Fri, 11 Mar 2011 20:16:17 +0000 Subject: [PATCH] Fix nsh/apps bug git-svn-id: svn://svn.code.sf.net/p/nuttx/code/trunk@3367 42af7a65-404d-4744-a932-0658087f49c3 --- ChangeLog | 7 +++++++ Documentation/NuttX.html | 9 ++++++++- examples/nsh/nsh_main.c | 16 +++++++++++----- 3 files changed, 26 insertions(+), 6 deletions(-) diff --git a/ChangeLog b/ChangeLog index 5ad653a30e4..0306a28de30 100644 --- a/ChangeLog +++ b/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/Documentation/NuttX.html b/Documentation/NuttX.html index 38e62ec95d0..a3763dcef55 100644 --- a/Documentation/NuttX.html +++ b/Documentation/NuttX.html @@ -8,7 +8,7 @@

NuttX RTOS

-

Last Updated: March 9, 2011

+

Last Updated: March 11, 2011

@@ -2159,6 +2159,13 @@ nuttx-5.19 2011-xx-xx Gregory Nutt <spudmonkey@racsa.co.cr> * 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 <spudmonkey@racsa.co.cr> diff --git a/examples/nsh/nsh_main.c b/examples/nsh/nsh_main.c index 680267e4340..f9a34f0a1da 100644 --- a/examples/nsh/nsh_main.c +++ b/examples/nsh/nsh_main.c @@ -492,12 +492,18 @@ static int nsh_execute(FAR struct nsh_vtbl_s *vtbl, int argc, char *argv[]) } } -#ifdef CONFIG_EXAMPLES_NSH_BUILTIN_APPS - if (handler == cmd_unrecognized) - { - /* Try to execute the command from a list of pre-built applications. */ + /* If the command was not found, then try to execute the command from + * a list of pre-built applications. + */ - return nsh_execapp(vtbl, cmd, argv); +#ifdef CONFIG_EXAMPLES_NSH_BUILTIN_APPS + if (handler == cmd_unrecognized && nsh_execapp(vtbl, cmd, argv) == OK) + { + /* The pre-built application was successfully started -- run OK. + * If not, then fall through to execute the cmd_nrecognized handler. + */ + + return OK; } #endif