summaryrefslogtreecommitdiff
path: root/apps
diff options
context:
space:
mode:
authorpatacongo <patacongo@42af7a65-404d-4744-a932-0658087f49c3>2011-03-14 14:14:54 +0000
committerpatacongo <patacongo@42af7a65-404d-4744-a932-0658087f49c3>2011-03-14 14:14:54 +0000
commitee2220174467b0e456446f5faaef1bd1660f786e (patch)
tree61937f54d7558e15f984b0450c2958e9ed45b5bd /apps
parent38121cceb67b2408c5aab1d3e9998accef0d83c8 (diff)
downloadpx4-nuttx-ee2220174467b0e456446f5faaef1bd1660f786e.tar.gz
px4-nuttx-ee2220174467b0e456446f5faaef1bd1660f786e.tar.bz2
px4-nuttx-ee2220174467b0e456446f5faaef1bd1660f786e.zip
VSN/apps update
git-svn-id: svn://svn.code.sf.net/p/nuttx/code/trunk@3378 42af7a65-404d-4744-a932-0658087f49c3
Diffstat (limited to 'apps')
-rwxr-xr-xapps/ChangeLog.txt10
-rw-r--r--apps/Makefile17
-rw-r--r--apps/README.txt12
-rw-r--r--apps/hello/hello.c32
4 files changed, 58 insertions, 13 deletions
diff --git a/apps/ChangeLog.txt b/apps/ChangeLog.txt
new file mode 100755
index 000000000..399e4c852
--- /dev/null
+++ b/apps/ChangeLog.txt
@@ -0,0 +1,10 @@
+5.19 2011-03-12 Gregory Nutt <spudmonkey@racsa.co.cr>
+
+ * Initial version of the apps/ directory was released as contributed by
+ Uros Platise.
+
+5.20 2011-xx-xx Gregory Nutt <spudmonkey@racsa.co.cr>
+
+ * README cosmetics
+ * hello world minor changes
+ * Makefile cosmetics (I am slowly adding the Darjeeling JVM) \ No newline at end of file
diff --git a/apps/Makefile b/apps/Makefile
index ac07176fb..40cae5a40 100644
--- a/apps/Makefile
+++ b/apps/Makefile
@@ -42,21 +42,28 @@ endif
# Application Directories
-BUILTIN_APPS_DIR =
+# we use a non-existing .built_always to guarantee that Makefile
+# always walks into the sub-directories and asks for build
BUILTIN_APPS_BUILT =
+BUILTIN_APPS_DIR =
ifeq ($(CONFIG_BUILTIN_APPS_NUTTX),y)
# Individual application: HELLO
ifeq ($(CONFIG_BUILTIN_APPS_HELLO),y)
-
BUILTIN_APPS_DIR += hello
-
-# we use a non-existing .built_always to guarantee that Makefile
-# always walks into the sub-directories and asks for build
BUILTIN_APPS_BUILT += hello/.built_always
+endif
+
+ifeq ($(CONFIG_BUILTIN_APPS_POWEROFF),y)
+BUILTIN_APPS_DIR += poweroff
+BUILTIN_APPS_BUILT += poweroff/.built_always
+endif
+ifeq ($(CONFIG_BUILTIN_APPS_JVM),y)
+BUILTIN_APPS_DIR += jvm
+BUILTIN_APPS_BUILT += jvm/.built_always
endif
# end of application list
diff --git a/apps/README.txt b/apps/README.txt
index e7bb212e4..1eda70f9a 100644
--- a/apps/README.txt
+++ b/apps/README.txt
@@ -5,11 +5,11 @@ Application Folder
This folder provides various applications found in sub-directories.
Application entry points with their requirements are gathered together in
-this folder, in two files:
+in two files:
- exec_nuttapp_proto.h Entry points, prototype function
- exec_nuttapp_list.h Application specific information and requirements
-Application information is collected during the make .depend process.
+Information is collected during the make .depend process.
To execute an application function:
exec_nuttapp() is defined in the include/nuttx/nuttapp.h
@@ -19,7 +19,7 @@ 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 nuttx/.config file as:
+preferences in the nuttx/.config file as:
To include applications under the nuttx apps directory:
CONFIG_BUILTIN_APPS_NUTTX=y/n
@@ -30,9 +30,9 @@ where each application can be controlled as:
When the user defines an option:
CONFIG_BUILTIN_APP_START=<application name>
-Note that application name must be provided in ".." as: "hello"
-for the hello application, which starts the immediately after system
-starts:
+that application shall be invoked immediately after system starts.
+Note that application name must be provided in ".." as: "hello",
+will call:
int hello_main(int argc, char *argv[])
Application skeleton can be found under the hello sub-directory,
diff --git a/apps/hello/hello.c b/apps/hello/hello.c
index d7818d351..fb94d0ea9 100644
--- a/apps/hello/hello.c
+++ b/apps/hello/hello.c
@@ -34,6 +34,24 @@
****************************************************************************/
#include <stdio.h>
+#include <stdlib.h>
+
+
+void memtest(void)
+{
+ char *p;
+ int i, j;
+
+ for (i=0; i<1000; i++) {
+ p = malloc(40000);
+ if (!p) {
+ printf("No memory\n");
+ break;
+ }
+ for (j=0; j<40000; j++) p[j] = 0;
+ free(p);
+ }
+}
/** Example of a standalone application
@@ -41,7 +59,17 @@
int hello_main(int argc, char *argv[])
{
int i;
- printf("Hello Builtin Application\nFound argc=%d arguments and are as follows:\n", argc);
- for (i=0; i<argc; i++) printf("%s\n", argv[i]);
+
+ printf("Hello Builtin Application\n"
+ "Found argc=%d arguments and are as follows:\n", argc);
+
+ // note that stdout is bufferred and that fflush() and is called on exit.
+ fflush(stdout);
+
+ for (i=0; i<argc; i++)
+ printf("%s\n", argv[i]);
+
+ //memtest();
+
return 0;
}