From 978bb750bf6dc3d2686b20c7ba09a52c7f9394ac Mon Sep 17 00:00:00 2001 From: patacongo Date: Sat, 12 Mar 2011 22:09:14 +0000 Subject: [PATCH] Prep for 5.19 release git-svn-id: svn://svn.code.sf.net/p/nuttx/code/trunk@3373 42af7a65-404d-4744-a932-0658087f49c3 --- Makefile | 1 + README => README.txt | 28 ++++++++++------------------ exec_nuttapp.c | 6 ++++-- 3 files changed, 15 insertions(+), 20 deletions(-) rename README => README.txt (63%) diff --git a/Makefile b/Makefile index 4ffca6343..ac07176fb 100644 --- a/Makefile +++ b/Makefile @@ -103,6 +103,7 @@ $(BIN): $(OBJS) $(BUILTIN_APPS_BUILT) $(CC) -- $(CFLAGS) -- $(SRCS) >Make.dep @touch $@ @for dir in $(BUILTIN_APPS_DIR) ; do \ + rm -f $$dir/.depend ; \ $(MAKE) -C $$dir TOPDIR="$(TOPDIR)" depend ; \ done diff --git a/README b/README.txt similarity index 63% rename from README rename to README.txt index 4ffee90c8..e7bb212e4 100644 --- a/README +++ b/README.txt @@ -2,9 +2,7 @@ Application Folder ================== -This folder provides various applications that can be enabled in the .config -file and further provides frame-work to include external user applications -from the ../apps directory. +This folder provides various applications found in sub-directories. Application entry points with their requirements are gathered together in this folder, in two files: @@ -16,15 +14,12 @@ Application information is collected during the make .depend process. To execute an application function: exec_nuttapp() is defined in the include/nuttx/nuttapp.h -Further, builtin applications may be accessed via pseudo file-system found -under the nuttx/drivers/sbin directory. - NuttShell provides transparent method of invoking the command, when the -following option is enabled (regardless of sbin pseudo file system): +following option is enabled: CONFIG_EXAMPLES_NSH_BUILTIN_APPS=y To select which application to be included in the build process set your -preferences the .config file as: +preferences the nuttx/.config file as: To include applications under the nuttx apps directory: CONFIG_BUILTIN_APPS_NUTTX=y/n @@ -32,14 +27,13 @@ To include applications under the nuttx apps directory: where each application can be controlled as: CONFIG_BUILTIN_APPS_=y/n -To include applications under the user ../apps directory: - CONFIG_BUILTIN_APPS_USER=y/n - -When the user defines an option: (NOT IMPLEMENTED YET) +When the user defines an option: CONFIG_BUILTIN_APP_START= - -then after initialization of the NuttX OS it starts this application -using the exec_nuttapp() method. + +Note that application name must be provided in ".." as: "hello" +for the hello application, which starts the immediately after system +starts: + int hello_main(int argc, char *argv[]) Application skeleton can be found under the hello sub-directory, which shows how an application can be added to the project. One must @@ -53,6 +47,4 @@ define: ASRCS = asm source file list as a.asm b.asm ... CSRCS = C source file list as foo1.c foo2.c .. - 4. add enable/disable option in the top file in this directory as: - ifeq CONFIG_BUILTIN_APPS_ - ... + 4. add application in the apps/Makefile diff --git a/exec_nuttapp.c b/exec_nuttapp.c index 3cc4b5139..84e592256 100644 --- a/exec_nuttapp.c +++ b/exec_nuttapp.c @@ -124,9 +124,11 @@ int exec_nuttapp(FAR const char *appname, FAR const char *argv[]) { #ifndef CONFIG_CUSTOM_STACK i = task_create(nuttapps[i].name, nuttapps[i].priority, - nuttapps[i].stacksize, nuttapps[i].main, &argv[1]); + nuttapps[i].stacksize, nuttapps[i].main, + (argv) ? &argv[1] : (const char **)NULL); #else - i = task_create(nuttapps[i].name, nuttapps[i].priority, nuttapps[i].main, &argv[1]); + i = task_create(nuttapps[i].name, nuttapps[i].priority, nuttapps[i].main, + (argv) ? &argv[1] : (const char **)NULL); #endif #if CONFIG_RR_INTERVAL > 0