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

View File

@@ -42,8 +42,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
)

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>
@@ -72,11 +71,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>
# if defined(FLASH_BASED_PARAMS)
# include <parameters/flashparams/flashfs.h>
@@ -260,24 +256,8 @@ static struct spi_dev_s *spi3;
__EXPORT int board_app_initialize(uintptr_t arg)
{
#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 */
@@ -285,11 +265,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
/* set up the serial DMA polling */
static struct hrt_call serial_dma_call;
struct timespec ts;