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
+1 -2
View File
@@ -43,8 +43,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 -32
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,12 +71,7 @@
#include <drivers/drv_hrt.h>
#include <drivers/drv_board_led.h>
#include <systemlib/px4_macros.h>
#include <systemlib/cpuload.h>
#include <perf/perf_counter.h>
#include <parameters/param.h>
#include <px4_init.h>
/****************************************************************************
* Pre-Processor Definitions
@@ -238,26 +232,7 @@ static struct sdio_dev_s *sdio;
__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 */
@@ -265,11 +240,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;
@@ -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();
+1 -2
View File
@@ -42,6 +42,5 @@ px4_add_library(drivers_board
)
target_link_libraries(drivers_board
PRIVATE
nuttx_apps # up_cxxinitialize
parameters # param_init
px4_layer
)
+2 -20
View File
@@ -52,7 +52,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>
@@ -68,8 +67,7 @@
#include <drivers/drv_hrt.h>
#include <drivers/drv_board_led.h>
#include <systemlib/cpuload.h>
#include <parameters/param.h>
#include <px4_init.h>
#if defined(CONFIG_HAVE_CXX) && defined(CONFIG_HAVE_CXXINITIALIZE)
#endif
@@ -162,24 +160,8 @@ __EXPORT int board_app_initialize(uintptr_t arg)
{
int result = OK;
#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();
/* set up the serial DMA polling */
static struct hrt_call serial_dma_call;
+1 -2
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
)
+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>
@@ -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>
/****************************************************************************
* Pre-Processor Definitions
@@ -255,24 +251,8 @@ static struct sdio_dev_s *sdio;
__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 */
@@ -280,11 +260,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;
+1 -2
View File
@@ -41,8 +41,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 -17
View File
@@ -55,7 +55,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>
@@ -75,11 +74,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>
#include <px4_i2c.h>
#include "up_internal.h"
@@ -209,13 +205,7 @@ stm32_boardinitialize(void)
__EXPORT int board_app_initialize(uintptr_t arg)
{
/* run C++ ctors before we go any further */
up_cxxinitialize();
/* configure the high-resolution time/callout interface */
hrt_init();
param_init();
px4_platform_init();
/* configure the DMA allocator */
@@ -223,11 +213,6 @@ __EXPORT int board_app_initialize(uintptr_t arg)
PX4_ERR("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;
+1 -2
View File
@@ -41,6 +41,5 @@ px4_add_library(drivers_board
target_link_libraries(drivers_board
PRIVATE
drivers__led # drv_led_start
nuttx_apps # up_cxxinitialize
parameters # param_init
px4_layer
)
+2 -26
View File
@@ -54,7 +54,6 @@
#include <debug.h>
#include <errno.h>
#include "platform/cxxinitialize.h"
#include <nuttx/board.h>
#include <nuttx/analog/adc.h>
#include <nuttx/spi/spi.h>
@@ -68,9 +67,7 @@
#include <drivers/drv_board_led.h>
#include <systemlib/px4_macros.h>
#include <systemlib/cpuload.h>
#include <systemlib/err.h>
#include <parameters/param.h>
#include <px4_init.h>
/****************************************************************************
* Pre-Processor Definitions
@@ -149,29 +146,8 @@ stm32_boardinitialize(void)
__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();
/* configure CPU load estimation */
#ifdef CONFIG_SCHED_INSTRUMENTATION
cpuload_initialize_once();
#endif
px4_platform_init();
/* set up the serial DMA polling */
static struct hrt_call serial_dma_call;
+1 -2
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
)
+2 -28
View File
@@ -53,7 +53,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>
@@ -68,11 +67,8 @@
#include <drivers/drv_hrt.h>
#include <drivers/drv_board_led.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
@@ -206,24 +202,7 @@ static struct spi_dev_s *spi4;
__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 */
@@ -231,11 +210,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;
+2 -3
View File
@@ -41,7 +41,6 @@ px4_add_library(drivers_board
target_link_libraries(drivers_board
PRIVATE
drivers__led # drv_led_start
nuttx_apps # up_cxxinitialize
parameters # param_init
modules__dataman # dm_flash_sector_description_set
px4_layer
modules__dataman # dm_flash_sector_description_set # TODO: fix this
)
+2 -26
View File
@@ -55,7 +55,6 @@
#include <debug.h>
#include <errno.h>
#include "platform/cxxinitialize.h"
#include <nuttx/board.h>
#include <nuttx/analog/adc.h>
@@ -70,9 +69,7 @@
#include <dataman/dataman.h>
#include <systemlib/px4_macros.h>
#include <systemlib/cpuload.h>
#include <systemlib/err.h>
#include <parameters/param.h>
#include <px4_init.h>
# if defined(FLASH_BASED_PARAMS)
# include <parameters/flashparams/flashfs.h>
@@ -175,29 +172,8 @@ __EXPORT int board_app_initialize(uintptr_t arg)
/* the interruption subsystem is not initialized when stm32_boardinitialize() is called */
stm32_gpiosetevent(GPIO_FORCE_BOOTLOADER, true, false, false, _bootloader_force_pin_callback, NULL);
#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();
/* configure CPU load estimation */
#ifdef CONFIG_SCHED_INSTRUMENTATION
cpuload_initialize_once();
#endif
px4_platform_init();
/* set up the serial DMA polling */
static struct hrt_call serial_dma_call;
+1 -2
View File
@@ -45,9 +45,8 @@ px4_add_library(drivers_board
target_link_libraries(drivers_board
PRIVATE
nuttx_apps # up_cxxinitialize
nuttx_arch # sdio
nuttx_drivers # sdio
drivers__led # drv_led_start
parameters # param_init
px4_layer
)
+3 -26
View File
@@ -53,7 +53,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>
@@ -73,9 +72,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 <px4_init.h>
/****************************************************************************
* Pre-Processor Definitions
@@ -278,24 +276,8 @@ __EXPORT int board_app_initialize(uintptr_t arg)
VDD_ETH_EN(true);
#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
param_init();
/* configure the high-resolution time/callout interface */
hrt_init();
px4_platform_init();
/* configure the DMA allocator */
@@ -303,11 +285,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 */
#ifdef SERIAL_HAVE_DMA
static struct hrt_call serial_dma_call;
+1 -2
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
)
+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>
@@ -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;
+1 -2
View File
@@ -41,9 +41,8 @@ px4_add_library(drivers_board
target_link_libraries(drivers_board
PRIVATE
nuttx_apps # up_cxxinitialize
nuttx_arch # sdio
nuttx_drivers # sdio
drivers__led # drv_led_start
parameters # param_init
px4_layer
)
+2 -20
View File
@@ -52,7 +52,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>
@@ -68,8 +67,7 @@
#include <drivers/drv_hrt.h>
#include <drivers/drv_board_led.h>
#include <systemlib/cpuload.h>
#include <parameters/param.h>
#include <px4_init.h>
#if defined(CONFIG_HAVE_CXX) && defined(CONFIG_HAVE_CXXINITIALIZE)
#endif
@@ -161,24 +159,8 @@ __EXPORT int board_app_initialize(uintptr_t arg)
{
int result = OK;
#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();
/* set up the serial DMA polling */
static struct hrt_call serial_dma_call;
+1 -2
View File
@@ -39,7 +39,6 @@ px4_add_library(drivers_board
target_link_libraries(drivers_board
PRIVATE
nuttx_apps # up_cxxinitialize
drivers__led # drv_led_start
parameters # param_init
px4_layer
)
+2 -20
View File
@@ -52,7 +52,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>
@@ -68,8 +67,7 @@
#include <drivers/drv_hrt.h>
#include <drivers/drv_board_led.h>
#include <systemlib/cpuload.h>
#include <parameters/param.h>
#include <px4_init.h>
#if defined(CONFIG_HAVE_CXX) && defined(CONFIG_HAVE_CXXINITIALIZE)
#endif
@@ -156,24 +154,8 @@ __EXPORT int board_app_initialize(uintptr_t arg)
int result = OK;
#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();
/* set up the serial DMA polling */
static struct hrt_call serial_dma_call;
+1 -2
View File
@@ -45,8 +45,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 -22
View File
@@ -55,7 +55,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>
@@ -73,11 +72,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
@@ -385,14 +381,6 @@ static struct sdio_dev_s *sdio;
__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();
#else
# error platform is dependent on c++ both CONFIG_HAVE_CXX and CONFIG_HAVE_CXXINITIALIZE must be defined.
#endif
/* Ensure the power is on 1 ms before we drive the GPIO pins */
px4_usleep(1000);
@@ -454,10 +442,7 @@ __EXPORT int board_app_initialize(uintptr_t arg)
/* configure SPI interfaces */
stm32_spiinitialize();
/* configure the high-resolution time/callout interface */
hrt_init();
param_init();
px4_platform_init();
/* configure the DMA allocator */
@@ -465,11 +450,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;
+1 -2
View File
@@ -45,8 +45,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 -22
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>
/****************************************************************************
* Pre-Processor Definitions
@@ -384,14 +380,6 @@ static struct sdio_dev_s *sdio;
__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();
#else
# error platform is dependent on c++ both CONFIG_HAVE_CXX and CONFIG_HAVE_CXXINITIALIZE must be defined.
#endif
/* Ensure the power is on 1 ms before we drive the GPIO pins */
usleep(1000);
@@ -453,10 +441,7 @@ __EXPORT int board_app_initialize(uintptr_t arg)
/* configure SPI interfaces */
stm32_spiinitialize();
/* configure the high-resolution time/callout interface */
hrt_init();
param_init();
px4_platform_init();
/* configure the DMA allocator */
@@ -464,11 +449,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;
+1 -2
View File
@@ -43,8 +43,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 -28
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>
@@ -73,11 +72,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
@@ -271,35 +267,13 @@ static struct sdio_dev_s *sdio;
__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.
if (board_dma_alloc_init() < 0) {
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;
+1 -2
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
)
+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>
@@ -73,11 +72,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
@@ -296,19 +292,6 @@ static struct sdio_dev_s *sdio;
__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
/* Bring up the Sensor power */
@@ -319,10 +302,7 @@ __EXPORT int board_app_initialize(uintptr_t arg)
stm32_spiinitialize();
/* configure the high-resolution time/callout interface */
hrt_init();
param_init();
px4_platform_init();
/* configure the DMA allocator */
@@ -330,11 +310,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;
+3 -3
View File
@@ -35,17 +35,17 @@ px4_add_library(drivers_board
#stm32_can.c # WIP
init.c
led.c
manifest.c
sdio.c
spi.c
timer_config.c
usb.c
manifest.c
)
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
@@ -55,7 +55,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>
@@ -75,11 +74,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>
#include "up_internal.h"
/****************************************************************************
@@ -273,22 +269,6 @@ __EXPORT int board_app_initialize(uintptr_t arg)
VDD_5V_RC_EN(true);
VDD_5V_WIFI_EN(true);
#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();
if (OK == board_determine_hw_info()) {
PX4_INFO("Rev 0x%1x : Ver 0x%1x %s", board_get_hw_revision(), board_get_hw_version(), board_get_hw_type_name());
@@ -297,7 +277,7 @@ __EXPORT int board_app_initialize(uintptr_t arg)
PX4_ERR("Failed to read HW revision and version");
}
param_init();
px4_platform_init();
/* configure the DMA allocator */
@@ -305,11 +285,6 @@ __EXPORT int board_app_initialize(uintptr_t arg)
PX4_ERR("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;
-1
View File
@@ -52,7 +52,6 @@
#include <debug.h>
#include <errno.h>
#include "platform/cxxinitialize.h"
#include <nuttx/board.h>
#include <stm32.h>
+1 -2
View File
@@ -40,9 +40,8 @@ px4_add_library(drivers_board
target_link_libraries(drivers_board
PRIVATE
nuttx_apps # up_cxxinitialize
nuttx_arch # sdio
nuttx_drivers # sdio
drivers__led # drv_led_start
parameters # param_init
px4_layer
)
+2 -28
View File
@@ -52,7 +52,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>
@@ -70,9 +69,7 @@
#include <drivers/drv_hrt.h>
#include <drivers/drv_board_led.h>
#include <systemlib/cpuload.h>
#include <perf/perf_counter.h>
#include <parameters/param.h>
#include <px4_init.h>
/****************************************************************************
* Pre-Processor Definitions
@@ -148,30 +145,7 @@ stm32_boardinitialize(void)
__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();
/* configure CPU load estimation */
#ifdef CONFIG_SCHED_INSTRUMENTATION
cpuload_initialize_once();
#endif
px4_platform_init();
/* set up the serial DMA polling */
static struct hrt_call serial_dma_call;
+1 -2
View File
@@ -43,9 +43,8 @@ px4_add_library(drivers_board
target_link_libraries(drivers_board
PRIVATE
nuttx_apps # up_cxxinitialize
nuttx_arch # sdio
nuttx_drivers # sdio
drivers__led # drv_led_start
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>
@@ -73,11 +72,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>
#include "up_internal.h"
/****************************************************************************
@@ -236,24 +232,8 @@ stm32_boardinitialize(void)
__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 */
@@ -261,11 +241,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;
@@ -42,6 +42,5 @@ px4_add_library(drivers_board
target_link_libraries(drivers_board
PRIVATE
nuttx_apps # up_cxxinitialize
drivers_arch
)
+2 -20
View File
@@ -52,7 +52,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>
@@ -68,8 +67,7 @@
#include <drivers/drv_hrt.h>
#include <drivers/drv_board_led.h>
#include <systemlib/cpuload.h>
#include <parameters/param.h>
#include <px4_init.h>
#if defined(CONFIG_HAVE_CXX) && defined(CONFIG_HAVE_CXXINITIALIZE)
#endif
@@ -148,24 +146,8 @@ __EXPORT int board_app_initialize(uintptr_t arg)
{
int result = OK;
#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();
/* set up the serial DMA polling */
static struct hrt_call serial_dma_call;