diff options
author | patacongo <patacongo@42af7a65-404d-4744-a932-0658087f49c3> | 2013-02-15 14:37:37 +0000 |
---|---|---|
committer | patacongo <patacongo@42af7a65-404d-4744-a932-0658087f49c3> | 2013-02-15 14:37:37 +0000 |
commit | 327fb90cd335dc8d61d66c81487f73a5fc6f19a5 (patch) | |
tree | 7783ffd51c6a828b6b135733f489a14d45734f68 /nuttx/sched | |
parent | 6132a9da939698fe9d5d3a7310d1287d5cb7a1a7 (diff) | |
download | px4-nuttx-327fb90cd335dc8d61d66c81487f73a5fc6f19a5.tar.gz px4-nuttx-327fb90cd335dc8d61d66c81487f73a5fc6f19a5.tar.bz2 px4-nuttx-327fb90cd335dc8d61d66c81487f73a5fc6f19a5.zip |
STM32 F4 patches from Petteri Aimonen (mostly USB)
git-svn-id: svn://svn.code.sf.net/p/nuttx/code/trunk@5652 42af7a65-404d-4744-a932-0658087f49c3
Diffstat (limited to 'nuttx/sched')
-rw-r--r-- | nuttx/sched/Kconfig | 28 | ||||
-rw-r--r-- | nuttx/sched/os_start.c | 6 |
2 files changed, 34 insertions, 0 deletions
diff --git a/nuttx/sched/Kconfig b/nuttx/sched/Kconfig index f9ba37cea..61900f498 100644 --- a/nuttx/sched/Kconfig +++ b/nuttx/sched/Kconfig @@ -3,6 +3,34 @@ # see misc/tools/kconfig-language.txt. # +config BOARD_INITIALIZE + bool "Custom board/driver initialization" + default n + ---help--- + By default, there are three points in time where you can insert + custom initialization logic: + + 1) <arch>_boardinitialize(): This function is used only for + initialize of very low-level things like configuration of + GPIO pins, power setting. The OS has not been initialized + at this point, so you cannot allocate memory or initialize + device drivers at this phase. + + 2) The next level of initialization is performed by a call to + up_initialize() (in arch/<arch>/src/common/up_initialize.c). + The OS has been initialized at this point and it is okay to + initialize drivers in this phase. + + 3) And, finally, when the user application code starts. + + If BOARD_INITIALIZE is selected, then an additional initialization + call will be performed in the boot-up sequence to a function + called board_initialize(). board_initialize() will be + call between phases 2) and 3) above, immediately after + up_initialize() is called. This additional initialization + phase may be used, for example, to initialize board-specific + device drivers. + config MSEC_PER_TICK int "Milliseconds per system timer tick" default 10 diff --git a/nuttx/sched/os_start.c b/nuttx/sched/os_start.c index 86b40bfbb..2e9991547 100644 --- a/nuttx/sched/os_start.c +++ b/nuttx/sched/os_start.c @@ -434,6 +434,12 @@ void os_start(void) up_initialize(); + /* Perform any special board-specific initialization, if so configured. */ + +#ifdef CONFIG_BOARD_INITIALIZE + board_initialize(); +#endif + /* Initialize the C libraries (if included in the link). This * is done last because the libraries may depend on the above. */ |