From 9d73fa6ced6e5b9a96cb63fb443981ec72d8312b Mon Sep 17 00:00:00 2001 From: patacongo Date: Mon, 24 Dec 2012 14:31:02 +0000 Subject: [PATCH] Correct round-to-ticks logic in sigtimedwait() git-svn-id: svn://svn.code.sf.net/p/nuttx/code/trunk@5457 42af7a65-404d-4744-a932-0658087f49c3 --- README.txt | 114 ++++++++++++++++++++++++++++++++++++++++++++--------- 1 file changed, 96 insertions(+), 18 deletions(-) diff --git a/README.txt b/README.txt index 4f043dcfa..328126905 100644 --- a/README.txt +++ b/README.txt @@ -17,15 +17,15 @@ Contents General ------- This folder provides various applications found in sub-directories. These -applications are not inherently a part of NuttX but are provided you help +applications are not inherently a part of NuttX but are provided to help you develop your own applications. The apps/ directory is a "break away" -part of the configuration that you may chose to use or not. +part of the configuration that you may choose to use or not. Directory Location ------------------ The default application directory used by the NuttX build should be named apps/ (or apps-x.y/ where x.y is the NuttX version number). This apps/ -directoy should appear in the directory tree at the same level as the +directory should appear in the directory tree at the same level as the NuttX directory. Like: . @@ -54,7 +54,7 @@ In this case, application entry points with their requirements are gathered together in two files: - builtin/builtin_proto.h Entry points, prototype function - - builtin/builtin_list.h Application specific information and requirements + - builtin/builtin_list.h Application specific information and requirements The build occurs in several phases as different build targets are executed: (1) context, (2) depend, and (3) default (all). Application information is @@ -96,11 +96,11 @@ after the NSH command. Application Configuration File ------------------------------ -A special configuration file is used to configure which applications -are to be included in the build. The source for this file is -configs///appconfig. The existence of the appconfig -file in the board configuration directory is sufficient to enable building -of applications. +The old-style NuttX configuration uses a special configuration file is +used to configure which applications are to be included in the build. +The source for this file is configs///appconfig. +The existence of the appconfig file in the board configuration directory\ +is sufficient to enable building of applications. The appconfig file is copied into the apps/ directory as .config when NuttX is configured. .config is included in the toplevel apps/Makefile. @@ -109,6 +109,38 @@ CONFIGURED_APPS list like: CONFIGURED_APPS += examples/hello system/poweroff +The new NuttX configuration uses kconfig-frontends tools and only the +NuttX .config file. The new configuration is indicated by the existence +of the definition CONFIG_NUTTX_NEWCONFIG=y in the NuttX .config file. +If CONFIG_NUTTX_NEWCONFIG is defined, then the Makefile will: + +- Assume that there is no apps/.config file and will instead +- Include Make.defs files from each of the subdirectories. + +When an application is enabled using the kconfig-frontends tool, then +a new definition is added to the NuttX .config file. For example, if +you want to enable apps/examples/hello then the old apps/.config would +have had: + + CONFIGURED_APPS += examples/hello + +But in the new configuration there will be no apps/.config file and, +instead, the NuttX .config will have: + + CONFIG_EXAMPLES_HELLO=y + +This will select the apps/examples/hello in the following way: + +- The top-level make will include examples/Make.defs +- examples/Make.defs will set CONFIGURED_APPS += examples/hello + like this: + + ifeq ($(CONFIG_EXAMPLES_HELLO),y) + CONFIGURED_APPS += examples/hello + endif + +Thus accomplishing the same thing with no apps/.config file. + Built-In Start-Up main() function ------------------------------ A builtin application can even be used as the main, start-up entry point @@ -130,17 +162,63 @@ An example application skeleton can be found under the examples/hello sub-directory. This example shows how a builtin application can be added to the project. One must define: - 1. create sub-directory as: appname - 2. provide entry point: appname_main() - 3. set the requirements in the file: Makefile, specially the lines: +Old configuration method: - APPNAME = appname - PRIORITY = SCHED_PRIORITY_DEFAULT - STACKSIZE = 768 - ASRCS = asm source file list as a.asm b.asm ... - CSRCS = C source file list as foo1.c foo2.c .. + 1. Create sub-directory as: appname - 4. add application in the apps/.config + 2. In this directory there should be: + + - A Makefile, and + - The application source code. + + 3. The application source code should provide the entry point: + appname_main() + + 4. Set the requirements in the file: Makefile, specially the lines: + + APPNAME = appname + PRIORITY = SCHED_PRIORITY_DEFAULT + STACKSIZE = 768 + ASRCS = asm source file list as a.asm b.asm ... + CSRCS = C source file list as foo1.c foo2.c .. + + Look at some of the other Makefiles for examples. Note the + special registration logic needed for the context: target + + 5. Add the to the application to the CONFIGIURED_APPS in the + apps/.config file: + + CONFIGURED_APPS += appname + +New Configuration Method: + + 1. Create sub-directory as: appname + + 2. In this directory there should be: + + - A Make.defs file that would be included by the apps/Makefile + - A Kconfig file that would be used by the configuration tool (see + misc/tools/kconfig-language.txt). This Kconfig file should be + included by the apps/Kconfig file + - A Makefile, and + - The application source code. + + 3. The application source code should provide the entry point: + appname_main() + + 4. Set the requirements in the file: Makefile, specially the lines: + + APPNAME = appname + PRIORITY = SCHED_PRIORITY_DEFAULT + STACKSIZE = 768 + ASRCS = asm source file list as a.asm b.asm ... + CSRCS = C source file list as foo1.c foo2.c .. + + 4b. The Make.defs file should include a line like: + + ifeq ($(CONFIG_APPNAME),y) + CONFIGURED_APPS += appname + endif Building NuttX with Board-Specific Pieces Outside the Source Tree -----------------------------------------------------------------