diff --git a/CMakeLists.txt b/CMakeLists.txt index da3f1d1d67..f3447a335f 100644 --- a/CMakeLists.txt +++ b/CMakeLists.txt @@ -394,7 +394,6 @@ add_subdirectory(src/lib EXCLUDE_FROM_ALL) add_subdirectory(platforms/${PX4_PLATFORM}/src/px4) add_subdirectory(platforms EXCLUDE_FROM_ALL) add_subdirectory(src/modules/uORB EXCLUDE_FROM_ALL) # TODO: platform layer -add_subdirectory(src/drivers/boards EXCLUDE_FROM_ALL) if(EXISTS "${PX4_BOARD_DIR}/CMakeLists.txt") add_subdirectory(${PX4_BOARD_DIR}) diff --git a/boards/airmind/mindpx-v2/src/init.c b/boards/airmind/mindpx-v2/src/init.c index 33374334ee..13a3e64b85 100644 --- a/boards/airmind/mindpx-v2/src/init.c +++ b/boards/airmind/mindpx-v2/src/init.c @@ -72,7 +72,7 @@ #include #include -#include +#include /**************************************************************************** * Pre-Processor Definitions diff --git a/boards/auav/x21/src/init.c b/boards/auav/x21/src/init.c index a7abc6bebb..74b5076e66 100644 --- a/boards/auav/x21/src/init.c +++ b/boards/auav/x21/src/init.c @@ -73,7 +73,7 @@ #include #include -#include +#include /**************************************************************************** * Pre-Processor Definitions diff --git a/boards/av/x-v1/src/init.c b/boards/av/x-v1/src/init.c index ecf9f5f27b..57d60e8b5a 100644 --- a/boards/av/x-v1/src/init.c +++ b/boards/av/x-v1/src/init.c @@ -72,7 +72,7 @@ #include #include #include -#include +#include static int configure_switch(void); diff --git a/boards/holybro/kakutef7/src/init.c b/boards/holybro/kakutef7/src/init.c index 7071ace29b..e49d17b61e 100644 --- a/boards/holybro/kakutef7/src/init.c +++ b/boards/holybro/kakutef7/src/init.c @@ -70,7 +70,7 @@ #include #include #include -#include +#include # if defined(FLASH_BASED_PARAMS) # include diff --git a/boards/modalai/fc-v1/src/init.c b/boards/modalai/fc-v1/src/init.c index 6413d2c6fc..79530da9f6 100644 --- a/boards/modalai/fc-v1/src/init.c +++ b/boards/modalai/fc-v1/src/init.c @@ -72,7 +72,7 @@ #include #include #include -#include +#include /**************************************************************************** * Pre-Processor Definitions diff --git a/boards/mro/ctrl-zero-f7/src/init.c b/boards/mro/ctrl-zero-f7/src/init.c index 3157160e55..5f4d28b7e3 100644 --- a/boards/mro/ctrl-zero-f7/src/init.c +++ b/boards/mro/ctrl-zero-f7/src/init.c @@ -70,7 +70,7 @@ #include #include #include -#include +#include /**************************************************************************** * Pre-Processor Definitions diff --git a/boards/nxp/fmuk66-v3/src/init.c b/boards/nxp/fmuk66-v3/src/init.c index 5f52b5a328..4c9e53c50f 100644 --- a/boards/nxp/fmuk66-v3/src/init.c +++ b/boards/nxp/fmuk66-v3/src/init.c @@ -75,7 +75,7 @@ #include #include -#include +#include /**************************************************************************** * Pre-Processor Definitions diff --git a/boards/omnibus/f4sd/src/init.c b/boards/omnibus/f4sd/src/init.c index 9fc49e2d4f..aa0162550f 100644 --- a/boards/omnibus/f4sd/src/init.c +++ b/boards/omnibus/f4sd/src/init.c @@ -73,7 +73,7 @@ #include #include -#include +#include # if defined(FLASH_BASED_PARAMS) # include diff --git a/boards/px4/fmu-v2/src/init.c b/boards/px4/fmu-v2/src/init.c index 33604f8ed8..a290ad1d85 100644 --- a/boards/px4/fmu-v2/src/init.c +++ b/boards/px4/fmu-v2/src/init.c @@ -73,7 +73,7 @@ #include #include -#include +#include /**************************************************************************** * Pre-Processor Definitions diff --git a/boards/px4/fmu-v3/src/init.c b/boards/px4/fmu-v3/src/init.c index 33604f8ed8..a290ad1d85 100644 --- a/boards/px4/fmu-v3/src/init.c +++ b/boards/px4/fmu-v3/src/init.c @@ -73,7 +73,7 @@ #include #include -#include +#include /**************************************************************************** * Pre-Processor Definitions diff --git a/boards/px4/fmu-v4/src/init.c b/boards/px4/fmu-v4/src/init.c index 706fbc59d3..b149d8a93a 100644 --- a/boards/px4/fmu-v4/src/init.c +++ b/boards/px4/fmu-v4/src/init.c @@ -74,7 +74,7 @@ #include #include -#include +#include /**************************************************************************** * Pre-Processor Definitions diff --git a/boards/px4/fmu-v4pro/src/init.c b/boards/px4/fmu-v4pro/src/init.c index 7370b8f204..7f7e195cde 100644 --- a/boards/px4/fmu-v4pro/src/init.c +++ b/boards/px4/fmu-v4pro/src/init.c @@ -74,7 +74,7 @@ #include #include -#include +#include /**************************************************************************** * Pre-Processor Definitions diff --git a/boards/px4/fmu-v5/src/init.c b/boards/px4/fmu-v5/src/init.c index 2367a2de81..d2681e7364 100644 --- a/boards/px4/fmu-v5/src/init.c +++ b/boards/px4/fmu-v5/src/init.c @@ -71,7 +71,7 @@ #include #include #include -#include +#include /**************************************************************************** * Pre-Processor Definitions diff --git a/boards/px4/fmu-v5x/src/init.c b/boards/px4/fmu-v5x/src/init.c index 33b191e201..506eba676e 100644 --- a/boards/px4/fmu-v5x/src/init.c +++ b/boards/px4/fmu-v5x/src/init.c @@ -71,7 +71,7 @@ #include #include #include -#include +#include /**************************************************************************** * Pre-Processor Definitions diff --git a/boards/uvify/core/src/init.c b/boards/uvify/core/src/init.c index 518885bb4d..bf608f39a1 100644 --- a/boards/uvify/core/src/init.c +++ b/boards/uvify/core/src/init.c @@ -74,7 +74,7 @@ #include #include -#include +#include /**************************************************************************** * Pre-Processor Definitions diff --git a/platforms/nuttx/CMakeLists.txt b/platforms/nuttx/CMakeLists.txt index 7830199188..05d4b3a854 100644 --- a/platforms/nuttx/CMakeLists.txt +++ b/platforms/nuttx/CMakeLists.txt @@ -78,7 +78,6 @@ endif() target_link_libraries(nuttx_arch INTERFACE drivers_board - drivers_boards_common arch_hrt ) diff --git a/platforms/nuttx/src/px4/common/CMakeLists.txt b/platforms/nuttx/src/px4/common/CMakeLists.txt index 9e12110814..4f37cc064c 100644 --- a/platforms/nuttx/src/px4/common/CMakeLists.txt +++ b/platforms/nuttx/src/px4/common/CMakeLists.txt @@ -35,6 +35,9 @@ if (NOT ${PX4_BOARD} MATCHES "px4_io") add_library(px4_layer + board_crashdump.c + board_dma_alloc.c + board_fat_dma_alloc.c console_buffer.cpp gpio.c px4_nuttx_tasks.c diff --git a/src/drivers/boards/common/board_crashdump.c b/platforms/nuttx/src/px4/common/board_crashdump.c similarity index 100% rename from src/drivers/boards/common/board_crashdump.c rename to platforms/nuttx/src/px4/common/board_crashdump.c diff --git a/src/drivers/boards/common/board_dma_alloc.c b/platforms/nuttx/src/px4/common/board_dma_alloc.c similarity index 100% rename from src/drivers/boards/common/board_dma_alloc.c rename to platforms/nuttx/src/px4/common/board_dma_alloc.c diff --git a/src/drivers/boards/common/board_fat_dma_alloc.c b/platforms/nuttx/src/px4/common/board_fat_dma_alloc.c similarity index 96% rename from src/drivers/boards/common/board_fat_dma_alloc.c rename to platforms/nuttx/src/px4/common/board_fat_dma_alloc.c index 3c54f2ed15..da3edb2b30 100644 --- a/src/drivers/boards/common/board_fat_dma_alloc.c +++ b/platforms/nuttx/src/px4/common/board_fat_dma_alloc.c @@ -38,10 +38,8 @@ */ #include -#include "board_config.h" - -#include "board_dma_alloc.h" -#include +#include +#include #if defined(CONFIG_FAT_DMAMEMORY) diff --git a/src/drivers/boards/common/board_dma_alloc.h b/platforms/nuttx/src/px4/common/include/px4_platform/board_dma_alloc.h similarity index 99% rename from src/drivers/boards/common/board_dma_alloc.h rename to platforms/nuttx/src/px4/common/include/px4_platform/board_dma_alloc.h index d4b85ed357..4a3ab76a2b 100644 --- a/src/drivers/boards/common/board_dma_alloc.h +++ b/platforms/nuttx/src/px4/common/include/px4_platform/board_dma_alloc.h @@ -44,6 +44,8 @@ #include #include +#include + /************************************************************************************ * Name: board_dma_alloc_init * diff --git a/src/drivers/boards/CMakeLists.txt b/src/drivers/boards/CMakeLists.txt deleted file mode 100644 index 0b2ad7992e..0000000000 --- a/src/drivers/boards/CMakeLists.txt +++ /dev/null @@ -1,34 +0,0 @@ -############################################################################ -# -# Copyright (c) 2015 PX4 Development Team. All rights reserved. -# -# Redistribution and use in source and binary forms, with or without -# modification, are permitted provided that the following conditions -# are met: -# -# 1. Redistributions of source code must retain the above copyright -# notice, this list of conditions and the following disclaimer. -# 2. Redistributions in binary form must reproduce the above copyright -# notice, this list of conditions and the following disclaimer in -# the documentation and/or other materials provided with the -# distribution. -# 3. Neither the name PX4 nor the names of its contributors may be -# used to endorse or promote products derived from this software -# without specific prior written permission. -# -# THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS -# "AS IS" AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT -# LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS -# FOR A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE -# COPYRIGHT OWNER OR CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, -# INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, -# BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS -# OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED -# AND ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT -# LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN -# ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE -# POSSIBILITY OF SUCH DAMAGE. -# -############################################################################ - -add_subdirectory(common) diff --git a/src/drivers/boards/common/CMakeLists.txt b/src/drivers/boards/common/CMakeLists.txt deleted file mode 100644 index 907d0d327d..0000000000 --- a/src/drivers/boards/common/CMakeLists.txt +++ /dev/null @@ -1,52 +0,0 @@ -############################################################################ -# -# Copyright (c) 2017 PX4 Development Team. All rights reserved. -# -# Redistribution and use in source and binary forms, with or without -# modification, are permitted provided that the following conditions -# are met: -# -# 1. Redistributions of source code must retain the above copyright -# notice, this list of conditions and the following disclaimer. -# 2. Redistributions in binary form must reproduce the above copyright -# notice, this list of conditions and the following disclaimer in -# the documentation and/or other materials provided with the -# distribution. -# 3. Neither the name PX4 nor the names of its contributors may be -# used to endorse or promote products derived from this software -# without specific prior written permission. -# -# THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS -# "AS IS" AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT -# LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS -# FOR A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE -# COPYRIGHT OWNER OR CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, -# INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, -# BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS -# OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED -# AND ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT -# LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN -# ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE -# POSSIBILITY OF SUCH DAMAGE. -# -############################################################################ - -# common board drivers (currently only for nuttx fmu boards) -if ((${PX4_PLATFORM} MATCHES "nuttx") AND NOT ${PX4_BOARD} MATCHES "px4_io") - - add_library(drivers_boards_common - board_crashdump.c - board_dma_alloc.c - board_fat_dma_alloc.c - ) - - target_link_libraries(drivers_boards_common - PRIVATE - nuttx_arch # bbsram - nuttx_mm # dma gran alloc - systemlib - ) - -else() - add_library(drivers_boards_common INTERFACE) -endif() diff --git a/src/lib/systemlib/print_load_nuttx.c b/src/lib/systemlib/print_load_nuttx.c index 06664b937e..c7edbf1437 100644 --- a/src/lib/systemlib/print_load_nuttx.c +++ b/src/lib/systemlib/print_load_nuttx.c @@ -47,7 +47,7 @@ #include #if defined(BOARD_DMA_ALLOC_POOL_SIZE) -#include +#include #endif /* BOARD_DMA_ALLOC_POOL_SIZE */ #if defined(CONFIG_SCHED_INSTRUMENTATION)