create PX4 platform layer initialization helper (#11269)

- starts requirements for PX4 modules (hrt, param, etc)
This commit is contained in:
Daniel Agar
2019-01-22 14:13:20 -05:00
committed by GitHub
parent 65fe3ce5d3
commit 320d2e9383
62 changed files with 327 additions and 560 deletions
@@ -44,8 +44,7 @@ px4_add_library(drivers_board
target_link_libraries(drivers_board
PRIVATE
drivers__led # drv_led_start
nuttx_apps # up_cxxinitialize
nuttx_arch # sdio
nuttx_drivers # sdio
parameters # param_init
px4_layer
)
+2 -27
View File
@@ -54,7 +54,6 @@
#include <debug.h>
#include <errno.h>
#include "platform/cxxinitialize.h"
#include <nuttx/board.h>
#include <nuttx/spi/spi.h>
#include <nuttx/i2c/i2c_master.h>
@@ -74,11 +73,8 @@
#include <drivers/drv_board_led.h>
#include <systemlib/px4_macros.h>
#include <systemlib/cpuload.h>
#include <perf/perf_counter.h>
#include <systemlib/err.h>
#include <parameters/param.h>
#include <px4_init.h>
/****************************************************************************
* Pre-Processor Definitions
@@ -237,24 +233,8 @@ __EXPORT int board_app_initialize(uintptr_t arg)
/* configure power supply control/sense pins */
#if defined(CONFIG_HAVE_CXX) && defined(CONFIG_HAVE_CXXINITIALIZE)
/* run C++ ctors before we go any further */
up_cxxinitialize();
# if defined(CONFIG_EXAMPLES_NSH_CXXINITIALIZE)
# error CONFIG_EXAMPLES_NSH_CXXINITIALIZE Must not be defined! Use CONFIG_HAVE_CXX and CONFIG_HAVE_CXXINITIALIZE.
# endif
#else
# error platform is dependent on c++ both CONFIG_HAVE_CXX and CONFIG_HAVE_CXXINITIALIZE must be defined.
#endif
/* configure the high-resolution time/callout interface */
hrt_init();
param_init();
px4_platform_init();
/* configure the DMA allocator */
@@ -262,11 +242,6 @@ __EXPORT int board_app_initialize(uintptr_t arg)
message("DMA alloc FAILED");
}
/* configure CPU load estimation */
#ifdef CONFIG_SCHED_INSTRUMENTATION
cpuload_initialize_once();
#endif
/* initial LED state */
drv_led_start();