Let's rename board_driver_initialize() to board_early_initialize() to emphasize its relationship to board_late_initialize().
This commit is contained in:
parent
a76e137ce2
commit
32a300806e
@ -939,7 +939,7 @@ struct nx_callback_s
|
||||
<p>
|
||||
The NX server may be started in your board startup logic by simply calling the function <code> nxmu_start()</code>.
|
||||
The board startup logic usually resides the the <code>configs/<i>board</i>/src</code> directory.
|
||||
The boar board startup logic can run automatically during the early system if <code>CONFIG_BOARD_LATE_INITIALIZE</code> is defined in the configuration.
|
||||
The board startup logic can run automatically during the early system if <code>CONFIG_BOARD_LATE_INITIALIZE</code> is defined in the configuration.
|
||||
Or, the board startup logic can execute under control of the application by calling the <code>boardctl(BOARDIOC_INIT, arg)</code> OS interface.
|
||||
</p>
|
||||
<p>
|
||||
|
@ -120,19 +120,19 @@
|
||||
****************************************************************************/
|
||||
|
||||
/****************************************************************************
|
||||
* Name: board_late_initialize
|
||||
* Name: board_early_initialize
|
||||
*
|
||||
* Description:
|
||||
* If CONFIG_BOARD_DRIVER_INITIALIZE is selected, then an additional
|
||||
* If CONFIG_BOARD_EARLY_INITIALIZE is selected, then an additional
|
||||
* initialization call will be performed in the boot-up sequence to a
|
||||
* function called board_driver_initialize(). board_driver_initialize()
|
||||
* function called board_early_initialize(). board_early_initialize()
|
||||
* will be called immediately after up_initialize() and well before
|
||||
* board_driver_initialize() is called and the initial application is
|
||||
* started. The context in which board_driver_initialize() executes is
|
||||
* board_early_initialize() is called and the initial application is
|
||||
* started. The context in which board_early_initialize() executes is
|
||||
* suitable for early initialization of most, simple device drivers and
|
||||
* is a logical, board-specific extension of up_initialize().
|
||||
*
|
||||
* board_driver_initialize() runs on the startup, initialization thread.
|
||||
* board_early_initialize() runs on the startup, initialization thread.
|
||||
* Some initialization operations cannot be performed on the start-up,
|
||||
* initialization thread. That is because the initialization thread
|
||||
* cannot wait for event. Waiting may be required, for example, to
|
||||
@ -142,8 +142,8 @@
|
||||
|
||||
****************************************************************************/
|
||||
|
||||
#ifdef CONFIG_BOARD_DRIVER_INITIALIZE
|
||||
void board_driver_initialize(void);
|
||||
#ifdef CONFIG_BOARD_EARLY_INITIALIZE
|
||||
void board_early_initialize(void);
|
||||
#endif
|
||||
|
||||
/****************************************************************************
|
||||
@ -153,10 +153,10 @@ void board_driver_initialize(void);
|
||||
* If CONFIG_BOARD_LATE_INITIALIZE is selected, then an additional
|
||||
* initialization call will be performed in the boot-up sequence to a
|
||||
* function called board_late_initialize(). board_late_initialize() will
|
||||
* be called after up_initialize() and board_driver_initialize() and just
|
||||
* be called after up_initialize() and board_early_initialize() and just
|
||||
* before the initial application is started. This additional
|
||||
* initialization phase may be used, for example, to initialize board-
|
||||
* specific device drivers for which board_driver_initialize() is not
|
||||
* specific device drivers for which board_early_initialize() is not
|
||||
* suitable.
|
||||
*
|
||||
* Waiting for events, use of I2C, SPI, etc are permissable in the context
|
||||
|
@ -1147,8 +1147,8 @@ endif # PRIORITY_INHERITANCE
|
||||
|
||||
menu "RTOS hooks"
|
||||
|
||||
config BOARD_DRIVER_INITIALIZE
|
||||
bool "Custom board driver initialization"
|
||||
config BOARD_EARLY_INITIALIZE
|
||||
bool "Custom board early initialization"
|
||||
default n
|
||||
---help---
|
||||
By default, there are three points in time where you can insert
|
||||
@ -1166,13 +1166,13 @@ config BOARD_DRIVER_INITIALIZE
|
||||
initialize drivers in this phase.
|
||||
|
||||
At this same point in time, the OS will also call a board-
|
||||
specific initialization function named board_driver_initialize()
|
||||
if CONFIG_BOARD_DRIVER_INITIALIZE is selectd. The context in
|
||||
which board_driver_initialize() executes is suitable for early
|
||||
specific initialization function named board_early_initialize()
|
||||
if CONFIG_BOARD_EARLY_INITIALIZE is selectd. The context in
|
||||
which board_early_initialize() executes is suitable for early
|
||||
initialization of most, simple device drivers and is a logical,
|
||||
board-specific extension of up_initialize().
|
||||
|
||||
board_driver_initialize() runs on the startup, initialization thread.
|
||||
board_early_initialize() runs on the startup, initialization thread.
|
||||
Some initialization operations cannot be performed on the start-up,
|
||||
initialization thread. That is because the initialization thread
|
||||
cannot wait for event. Waiting may be required, for example, to
|
||||
@ -1214,13 +1214,13 @@ config BOARD_LATE_INITIALIZE
|
||||
initialize drivers in this phase.
|
||||
|
||||
At this same point in time, the OS will also call a board-
|
||||
specific initialization function named board_driver_initialize()
|
||||
if CONFIG_BOARD_DRIVER_INITIALIZE is selectd. The context in
|
||||
which board_driver_initialize() executes is suitable for early
|
||||
specific initialization function named board_early_initialize()
|
||||
if CONFIG_BOARD_EARLY_INITIALIZE is selectd. The context in
|
||||
which board_early_initialize() executes is suitable for early
|
||||
initialization of most, simple device drivers and is a logical,
|
||||
board-specific extension of up_initialize().
|
||||
|
||||
board_driver_initialize() runs on the startup, initialization thread.
|
||||
board_early_initialize() runs on the startup, initialization thread.
|
||||
Some initialization operations cannot be performed on the start-up,
|
||||
initialization thread. That is because the initialization thread
|
||||
cannot wait for event. Waiting may be required, for example, to
|
||||
|
@ -45,6 +45,7 @@
|
||||
#include <debug.h>
|
||||
|
||||
#include <nuttx/arch.h>
|
||||
#include <nuttx/board.h>
|
||||
#include <nuttx/compiler.h>
|
||||
#include <nuttx/sched.h>
|
||||
#include <nuttx/fs/fs.h>
|
||||
@ -718,16 +719,16 @@ void nx_start(void)
|
||||
|
||||
up_initialize();
|
||||
|
||||
#ifdef CONFIG_BOARD_DRIVER_INITIALIZE
|
||||
#ifdef CONFIG_BOARD_EARLY_INITIALIZE
|
||||
/* Call the board-specific up_initialize() extension to support
|
||||
* early initialization of board-specific drivers and resources
|
||||
* that cannot wait until board_late_initialize.
|
||||
*/
|
||||
|
||||
board_driver_initialize();
|
||||
board_early_initialize();
|
||||
#endif
|
||||
|
||||
/* Hardware resources are available */
|
||||
/* Hardware resources are now available */
|
||||
|
||||
g_nx_initstate = OSINIT_HARDWARE;
|
||||
|
||||
|
Loading…
Reference in New Issue
Block a user