diff --git a/.gitignore b/.gitignore
index a3f666c6c27a..2a14fd8c2eeb 100644
--- a/.gitignore
+++ b/.gitignore
@@ -74,7 +74,7 @@ vectorcontrol/
.idea
cmake-build-*/
-posix-configs/SITL/init/test/*_generated
+platforms/posix/posix-configs/SITL/init/test/*_generated
parameters.md
airframes.md
diff --git a/.gitmodules b/.gitmodules
index 5f8d8ec43113..1982bf3676ae 100644
--- a/.gitmodules
+++ b/.gitmodules
@@ -4,11 +4,11 @@
[submodule "mavlink/include/mavlink/v2.0"]
path = mavlink/include/mavlink/v2.0
url = https://github.com/mavlink/c_library_v2.git
-[submodule "NuttX"]
- path = NuttX
+[submodule "platforms/nuttx/NuttX"]
+ path = platforms/nuttx/NuttX
url = https://github.com/PX4/PX4NuttX.git
-[submodule "src/modules/uavcan/libuavcan"]
- path = src/modules/uavcan/libuavcan
+[submodule "platforms/nuttx/src/modules/uavcan/libuavcan"]
+ path = platforms/nuttx/src/modules/uavcan/libuavcan
url = https://github.com/UAVCAN/libuavcan.git
[submodule "Tools/genmsg"]
path = Tools/genmsg
@@ -31,8 +31,8 @@
[submodule "src/lib/ecl"]
path = src/lib/ecl
url = https://github.com/PX4/ecl.git
-[submodule "cmake/cmake_hexagon"]
- path = cmake/cmake_hexagon
+[submodule "platforms/qurt/cmake/cmake_hexagon"]
+ path = platforms/qurt/cmake/cmake_hexagon
url = https://github.com/ATLFlight/cmake_hexagon
[submodule "src/drivers/gps/devices"]
path = src/drivers/gps/devices
diff --git a/CMakeLists.txt b/CMakeLists.txt
index 356a8fd20e83..caf8b6d18ab5 100644
--- a/CMakeLists.txt
+++ b/CMakeLists.txt
@@ -128,14 +128,44 @@ execute_process(
set(CONFIG "posix_sitl_default" CACHE STRING "desired configuration")
string(REPLACE "_" ";" config_args ${CONFIG})
-list(GET config_args 0 OS)
-list(GET config_args 1 BOARD)
-list(GET config_args 2 LABEL)
-set(target_name "${OS}-${BOARD}-${LABEL}")
+list(APPEND CMAKE_MODULE_PATH "${PX4_SOURCE_DIR}/cmake")
-file(GLOB_RECURSE configs RELATIVE cmake/configs "cmake/configs/*.cmake")
-set_property(CACHE CONFIG PROPERTY STRINGS ${configs})
+list(GET config_args 0 TOKEN)
+
+if ("${TOKEN}" STREQUAL "V")
+ # Vendor
+ list(GET config_args 1 VENDOR)
+ list(GET config_args 2 OS)
+ list(GET config_args 3 BOARD)
+ list(GET config_args 4 LABEL)
+ set(config_module "config_${LABEL}")
+ set(target_name "${VENDOR}-${OS}-${BOARD}-${LABEL}")
+ list(APPEND CMAKE_MODULE_PATH "${CMAKE_SOURCE_DIR}/vendor/${VENDOR}/${OS}/${BOARD}")
+ list(APPEND CMAKE_MODULE_PATH "${CMAKE_SOURCE_DIR}/vendor/${VENDOR}/${OS}/cmake")
+ list(APPEND CMAKE_MODULE_PATH "${CMAKE_SOURCE_DIR}/vendor/${VENDOR}/cmake")
+ include_directories(${CMAKE_SOURCE_DIR}/vendor/${VENDOR}/${OS}/${BOARD})
+ add_subdirectory(vendor/${VENDOR})
+else()
+ list(GET config_args 0 OS)
+ list(GET config_args 1 BOARD)
+ list(GET config_args 2 LABEL)
+ set(target_name "${OS}-${BOARD}-${LABEL}")
+
+ string(REGEX MATCH "^px4-.*" px4tgt ${BOARD})
+ MESSAGE("px4tgt = ${px4tgt} BOARD = ${BOARD}")
+ if (NOT "${px4tgt}" STREQUAL "")
+ string(REGEX REPLACE "^px4-" "" px4board ${BOARD})
+ MESSAGE("px4board = ${px4tgt} BOARD = ${BOARD}")
+ list(APPEND CMAKE_MODULE_PATH "${PX4_SOURCE_DIR}/platforms/${OS}/boards/px4/${px4board}")
+ include_directories("${PX4_SOURCE_DIR}/platforms/${OS}/boards/px4/${px4board}")
+ else()
+ list(APPEND CMAKE_MODULE_PATH "${PX4_SOURCE_DIR}/platforms/${OS}/boards/${BOARD}")
+ include_directories("${PX4_SOURCE_DIR}/platforms/${OS}/boards/${BOARD}")
+ endif()
+ set(config_module "config_${LABEL}")
+endif()
+list(APPEND CMAKE_MODULE_PATH "${PX4_SOURCE_DIR}/platforms/${OS}/cmake")
set(THREADS "4" CACHE STRING "number of threads to use for external build processes")
set(DEBUG_PORT "/dev/ttyACM0" CACHE STRING "debugging port")
set(EXTERNAL_MODULES_LOCATION "" CACHE STRING "External modules source location")
@@ -144,9 +174,7 @@ if (NOT EXTERNAL_MODULES_LOCATION STREQUAL "")
get_filename_component(EXTERNAL_MODULES_LOCATION "${EXTERNAL_MODULES_LOCATION}" ABSOLUTE)
endif()
-list(APPEND CMAKE_MODULE_PATH "${PX4_SOURCE_DIR}/cmake")
message(STATUS "CMAKE_MODULE_PATH: ${CMAKE_MODULE_PATH}")
-set(config_module "configs/${CONFIG}")
include(${config_module})
include(common/coverage)
@@ -447,7 +475,11 @@ foreach(module ${config_module_list})
STRING(REGEX REPLACE "/" "__" EXT_MODULE_PREFIX ${EXT_MODULE})
add_subdirectory(${module} ${PX4_BINARY_DIR}/${EXT_MODULE_PREFIX})
else()
- add_subdirectory(src/${module})
+ if (EXISTS ${PX4_SOURCE_DIR}/platforms/${OS}/src/${module}/CMakeLists.txt)
+ add_subdirectory(platforms/${OS}/src/${module})
+ else()
+ add_subdirectory(src/${module})
+ endif()
endif()
px4_mangle_name(${module} mangled_name)
list(APPEND module_libraries ${mangled_name})
@@ -456,10 +488,10 @@ endforeach()
# Keep track of external shared libs required for modules
set(module_external_libraries "${module_external_libraries}" CACHE INTERNAL "module_external_libraries")
-add_subdirectory(src/firmware/${OS})
+add_subdirectory(platforms/${OS}/src/firmware/${OS})
if (config_io_board)
- add_subdirectory(src/modules/px4iofirmware)
+ add_subdirectory(platforms/nuttx/src/modules/px4iofirmware)
endif()
#=============================================================================
diff --git a/Makefile b/Makefile
index d4cf3e24cf14..1f0e5a157cf6 100644
--- a/Makefile
+++ b/Makefile
@@ -146,7 +146,10 @@ define colorecho
endef
# Get a list of all config targets.
-ALL_CONFIG_TARGETS := $(basename $(shell find "$(SRC_DIR)/cmake/configs" ! -name '*_common*' ! -name '*_sdflight_*' -name '*.cmake' -print | sed -e 's:^.*/::' | sort))
+PX4_CONFIG_TARGETS := $(shell ls $(SRC_DIR)/platforms/*/boards/px4/*/config_*.cmake | sed -e "s:$(SRC_DIR)/platforms/\(.*\)/boards/px4/:\1_px4-:" -e "s~/config_\(.*\)\.cmake~/\1~" -e "s~/~_~g")
+OTHER_CONFIG_TARGETS := $(shell ls $(SRC_DIR)/platforms/*/boards/*/config_*.cmake | sed -e "s:$(SRC_DIR)/platforms/\(.*\)/boards/\(.*\):\1_\2:" -e "s~/config_\(.*\)\.cmake~/\1~" -e "s~/~_~g")
+VENDOR_CONFIG_TARGETS := $(shell ls vendor/*/*/*/config_*.cmake | sed -e "s~^vendor/\(.*\)\.cmake~V_\1~" -e "s~/config_~/~" -e "s~/~_~g")
+ALL_CONFIG_TARGETS := $(shell echo ${PX4_CONFIG_TARGETS} ${OTHER_CONFIG_TARGETS} ${VENDOR_CONFIG_TARGETS} | tr " " "\n" | sort)
# Strip off leading nuttx_
NUTTX_CONFIG_TARGETS := $(patsubst nuttx_%,%,$(filter nuttx_%,$(ALL_CONFIG_TARGETS)))
@@ -170,10 +173,10 @@ posix: posix_sitl_default
broadcast: posix_sitl_broadcast
# Multi- config targets.
-eagle_default: posix_eagle_default qurt_eagle_default
-eagle_legacy_default: posix_eagle_legacy qurt_eagle_legacy
-excelsior_default: posix_excelsior_default qurt_excelsior_default
-excelsior_legacy_default: posix_excelsior_legacy qurt_excelsior_legacy
+eagle_default: V_ATLFlight_posix_eagle_default V_ATLFlight_qurt_eagle_default
+eagle_legacy_default: V_ATLFlight_posix_eagle_legacy V_ATLFlight_qurt_eagle_legacy
+excelsior_default: V_ATLFlight_posix_excelsior_default V_ATLFlight_qurt_excelsior_default
+excelsior_legacy_default: V_ATLFlight_posix_excelsior_legacy V_ATLFlight_qurt_excelsior_legacy
# All targets with just dependencies but no recipe must either be marked as phony (or have the special @: as recipe).
@@ -189,12 +192,12 @@ qgc_firmware: px4fmu_firmware misc_qgc_extra_firmware sizes
# px4fmu NuttX firmware
px4fmu_firmware: \
- check_px4fmu-v1_default \
- check_px4fmu-v2_default \
- check_px4fmu-v3_default \
- check_px4fmu-v4_default \
- check_px4fmu-v4pro_default \
- check_px4fmu-v5_default \
+ check_px4-fmu-v1_default \
+ check_px4-fmu-v2_default \
+ check_px4-fmu-v3_default \
+ check_px4-fmu-v4_default \
+ check_px4-fmu-v4pro_default \
+ check_px4-fmu-v5_default \
sizes
misc_qgc_extra_firmware: \
@@ -210,17 +213,17 @@ misc_qgc_extra_firmware: \
# Other NuttX firmware
alt_firmware: \
check_px4-stm32f4discovery_default \
- check_px4cannode-v1_default \
- check_px4esc-v1_default \
- check_px4nucleoF767ZI-v1_default \
+ check_px4-cannode-v1_default \
+ check_px4-esc-v1_default \
+ check_px4-nucleoF767ZI-v1_default \
check_s2740vc-v1_default \
sizes
checks_bootloaders: \
check_esc35-v1_bootloader \
- check_px4cannode-v1_bootloader \
- check_px4esc-v1_bootloader \
- check_px4flow-v2_bootloader \
+ check_px4-cannode-v1_bootloader \
+ check_px4-esc-v1_bootloader \
+ check_px4-flow-v2_bootloader \
check_s2740vc-v1_bootloader \
# not fitting in flash check_zubaxgnss-v1_bootloader \
sizes
@@ -232,7 +235,7 @@ sizes:
check: check_posix_sitl_default px4fmu_firmware misc_qgc_extra_firmware alt_firmware checks_bootloaders tests check_format
# quick_check builds a single nuttx and posix target, runs testing, and checks the style
-quick_check: check_posix_sitl_default check_px4fmu-v3_default tests check_format
+quick_check: check_posix_sitl_default check_px4-fmu-v3_default tests check_format
check_%:
@echo
@@ -395,8 +398,6 @@ distclean: submodulesclean gazeboclean
$(if $(filter $(FIRST_ARG),$@), \
$(error "$@ cannot be the first argument. Use '$(MAKE) help|list_config_targets' to get a list of all possible [configuration] targets."),@#)
-CONFIGS:=$(shell ls cmake/configs | sed -e "s~.*/~~" | sed -e "s~\..*~~")
-
#help:
# @echo
# @echo "Type 'make ' and hit the tab key twice to see a list of the available"
diff --git a/Tools/px4airframes/rcout.py b/Tools/px4airframes/rcout.py
index 3dfd2720d1e7..4b33957e79e1 100644
--- a/Tools/px4airframes/rcout.py
+++ b/Tools/px4airframes/rcout.py
@@ -58,5 +58,6 @@ def __init__(self, groups, board):
self.output = result;
def Save(self, filename):
+ print("Writing to %s" % filename)
with codecs.open(filename, 'w', 'utf-8') as f:
f.write(self.output)
diff --git a/Tools/px_update_git_header.py b/Tools/px_update_git_header.py
index 95f8a8e6cc33..ed7e55c53776 100755
--- a/Tools/px_update_git_header.py
+++ b/Tools/px_update_git_header.py
@@ -23,12 +23,6 @@
except:
git_branch_name = ''
git_version_short = git_version[0:16]
-nuttx_git_tag = subprocess.check_output('git describe --always --tags --match nuttx-* --dirty'.split(),
- cwd='NuttX/nuttx', stderr=subprocess.STDOUT).decode('utf-8').strip().replace("nuttx-","v")
-nuttx_git_tag = re.sub('-.*','.0',nuttx_git_tag)
-nuttx_git_version = subprocess.check_output('git rev-parse --verify HEAD'.split(),
- cwd='NuttX/nuttx', stderr=subprocess.STDOUT).decode('utf-8').strip()
-nuttx_git_version_short = nuttx_git_version[0:16]
mavlink_git_version = subprocess.check_output('git rev-parse --verify HEAD'.split(),
cwd='mavlink/include/mavlink/v2.0', stderr=subprocess.STDOUT).decode('utf-8').strip()
mavlink_git_version_short = mavlink_git_version[0:16]
@@ -43,19 +37,12 @@
#define PX4_GIT_TAG_STR "{git_tag}"
#define PX4_GIT_BRANCH_NAME "{git_branch_name}"
-#define NUTTX_GIT_VERSION_STR "{nuttx_git_version}"
-#define NUTTX_GIT_VERSION_BINARY 0x{nuttx_git_version_short}
-#define NUTTX_GIT_TAG_STR "{nuttx_git_tag}"
-
#define MAVLINK_LIB_GIT_VERSION_STR "{mavlink_git_version}"
#define MAVLINK_LIB_GIT_VERSION_BINARY 0x{mavlink_git_version_short}
""".format(git_tag=git_tag,
git_version=git_version,
git_version_short=git_version_short,
git_branch_name=git_branch_name,
- nuttx_git_version=nuttx_git_version,
- nuttx_git_version_short=nuttx_git_version_short,
- nuttx_git_tag=nuttx_git_tag,
mavlink_git_version=mavlink_git_version,
mavlink_git_version_short=mavlink_git_version_short)
diff --git a/Tools/refactor/mv_config.sh b/Tools/refactor/mv_config.sh
new file mode 100755
index 000000000000..fd12ecc59b09
--- /dev/null
+++ b/Tools/refactor/mv_config.sh
@@ -0,0 +1,13 @@
+#!/bin/bash
+# $1 is srcdir
+# $2 is ${OS}/boards dir
+src=`realpath $1`
+dest=`realpath $2`
+for f in `cd $src && ls *.cmake `; do
+ cd $dest
+ echo $dest
+ boarddir="$dest/`echo $f | cut -d'_' -f2`"
+ mkdir -p $boarddir
+ git mv $src/$f $boarddir/config_`echo $f | cut -d'_' -f 3`
+done
+
diff --git a/Tools/refactor/renamepx4boards.sh b/Tools/refactor/renamepx4boards.sh
new file mode 100644
index 000000000000..2e32e3a90461
--- /dev/null
+++ b/Tools/refactor/renamepx4boards.sh
@@ -0,0 +1,2 @@
+#!/bin/bash
+for f in `ls px4[!-]*`; do git mv $f `echo $f | sed -e "s~^px4~px4-~"`; done
diff --git a/Tools/sitl_multiple_run.sh b/Tools/sitl_multiple_run.sh
index 82bf79f0d063..5501741c6746 100755
--- a/Tools/sitl_multiple_run.sh
+++ b/Tools/sitl_multiple_run.sh
@@ -16,7 +16,7 @@ port_step=10
SCRIPT_DIR="$( cd "$( dirname "${BASH_SOURCE[0]}" )" && pwd )"
src_path="$SCRIPT_DIR/.."
-rc_script="posix-configs/SITL/init/ekf2/multiple_iris"
+rc_script="platforms/posix/posix-configs/SITL/init/ekf2/multiple_iris"
build_path=${src_path}/build_posix_sitl_default
echo "killing running instances"
diff --git a/Tools/sitl_run.sh b/Tools/sitl_run.sh
index 28e8c1bc51e7..fca7ca11e4e5 100755
--- a/Tools/sitl_run.sh
+++ b/Tools/sitl_run.sh
@@ -23,7 +23,7 @@ echo src_path: $src_path
echo build_path: $build_path
working_dir=`pwd`
-sitl_bin=$build_path/src/firmware/posix/px4
+sitl_bin=$build_path/platforms/posix/src/firmware/posix/px4
rootfs=$build_path/tmp/rootfs
if [ "$chroot" == "1" ]
diff --git a/cmake/cmake_hexagon b/cmake/cmake_hexagon
deleted file mode 160000
index 07168bd57158..000000000000
--- a/cmake/cmake_hexagon
+++ /dev/null
@@ -1 +0,0 @@
-Subproject commit 07168bd5715818802b78f674816ec851307998a7
diff --git a/cmake/common/px4_base.cmake b/cmake/common/px4_base.cmake
index 5e65b524e597..f0f8de150787 100644
--- a/cmake/common/px4_base.cmake
+++ b/cmake/common/px4_base.cmake
@@ -456,17 +456,32 @@ function(px4_add_common_flags)
${_optimization_flags}
)
+ if ("${BOARD_FILE_DIRS}" STREQUAL "")
+ set(BOARD_FILE_DIRS
+ ${PX4_SOURCE_DIR}/platforms/${OS}/src/drivers/boards/${BOARD}
+ ${PX4_SOURCE_DIR}/src/drivers/boards
+ )
+ endif()
+
set(added_include_dirs
${PX4_BINARY_DIR}
+ ${PX4_BINARY_DIR}/platforms/${OS}/src
${PX4_BINARY_DIR}/src
+ ${PX4_BINARY_DIR}/platforms/${OS}/src/modules
${PX4_BINARY_DIR}/src/modules
+ ${PX4_BINARY_DIR}/platforms/${OS}/src
${PX4_SOURCE_DIR}/src
- ${PX4_SOURCE_DIR}/src/drivers/boards/${BOARD}
+ ${PX4_SOURCE_DIR}/platforms/${OS}/src
+ ${BOARD_FILE_DIRS}
+ ${PX4_SOURCE_DIR}/platforms/${OS}/src/include
${PX4_SOURCE_DIR}/src/include
+ ${PX4_SOURCE_DIR}/platforms/${OS}/src/lib
${PX4_SOURCE_DIR}/src/lib
${PX4_SOURCE_DIR}/src/lib/DriverFramework/framework/include
${PX4_SOURCE_DIR}/src/lib/matrix
+ ${PX4_SOURCE_DIR}/platforms/${OS}/src/modules
${PX4_SOURCE_DIR}/src/modules
+ ${PX4_SOURCE_DIR}/platforms/${OS}/src/platforms
${PX4_SOURCE_DIR}/src/platforms
)
diff --git a/cmake/configs/posix_sitl_broadcast.cmake b/cmake/configs/posix_sitl_broadcast.cmake
deleted file mode 100644
index 1dd45e0d56a2..000000000000
--- a/cmake/configs/posix_sitl_broadcast.cmake
+++ /dev/null
@@ -1,3 +0,0 @@
-include(cmake/configs/posix_sitl_default.cmake)
-
-# This config is just the same as posix_sitl_default.
diff --git a/cmake/configs/posix_sitl_ekf2.cmake b/cmake/configs/posix_sitl_ekf2.cmake
deleted file mode 100644
index ae6191e50882..000000000000
--- a/cmake/configs/posix_sitl_ekf2.cmake
+++ /dev/null
@@ -1,5 +0,0 @@
-include(cmake/configs/posix_sitl_default.cmake)
-
-set(config_sitl_rcS_dir
- posix-configs/SITL/init/ekf2
- )
diff --git a/cmake/configs/posix_sitl_inav.cmake b/cmake/configs/posix_sitl_inav.cmake
deleted file mode 100644
index 3007a6b93017..000000000000
--- a/cmake/configs/posix_sitl_inav.cmake
+++ /dev/null
@@ -1,5 +0,0 @@
-include(cmake/configs/posix_sitl_default.cmake)
-
-set(config_sitl_rcS_dir
- posix-configs/SITL/init/inav
- )
\ No newline at end of file
diff --git a/cmake/configs/posix_sitl_lpe.cmake b/cmake/configs/posix_sitl_lpe.cmake
deleted file mode 100644
index 2dd53f2469a5..000000000000
--- a/cmake/configs/posix_sitl_lpe.cmake
+++ /dev/null
@@ -1,6 +0,0 @@
-include(cmake/configs/posix_sitl_default.cmake)
-
-# This is already the default, but lets explicitly set it again to lpe.
-set(config_sitl_rcS_dir
- posix-configs/SITL/init/lpe
- )
diff --git a/cmake/configs/posix_sitl_shell.cmake b/cmake/configs/posix_sitl_shell.cmake
deleted file mode 100644
index bf9fcd199288..000000000000
--- a/cmake/configs/posix_sitl_shell.cmake
+++ /dev/null
@@ -1,5 +0,0 @@
-include(cmake/configs/posix_sitl_default.cmake)
-
-set(config_sitl_rcS_dir
- posix-configs/SITL/init/shell
- )
diff --git a/cmake/configs/posix_sitl_test.cmake b/cmake/configs/posix_sitl_test.cmake
deleted file mode 100644
index 0e467f5de2f0..000000000000
--- a/cmake/configs/posix_sitl_test.cmake
+++ /dev/null
@@ -1,5 +0,0 @@
-include(cmake/configs/posix_sitl_default.cmake)
-
-set(config_sitl_rcS_dir
- posix-configs/SITL/init/test
- )
diff --git a/launch/mavros_posix_sitl.launch b/launch/mavros_posix_sitl.launch
index e387a5714b48..3370a0f47b36 100644
--- a/launch/mavros_posix_sitl.launch
+++ b/launch/mavros_posix_sitl.launch
@@ -14,7 +14,7 @@
-
+
diff --git a/launch/posix_sitl.launch b/launch/posix_sitl.launch
index f82359a35a63..bf5d18e66d24 100644
--- a/launch/posix_sitl.launch
+++ b/launch/posix_sitl.launch
@@ -11,7 +11,7 @@
-
+
@@ -40,4 +40,4 @@
-
\ No newline at end of file
+
diff --git a/launch/single_vehcile_spawn.launch b/launch/single_vehcile_spawn.launch
index fcf7f07ff888..0fbdfaf4f30a 100644
--- a/launch/single_vehcile_spawn.launch
+++ b/launch/single_vehcile_spawn.launch
@@ -10,7 +10,7 @@
-
+
diff --git a/platforms/PORTING.md b/platforms/PORTING.md
new file mode 100644
index 000000000000..640ce8729a04
--- /dev/null
+++ b/platforms/PORTING.md
@@ -0,0 +1,49 @@
+# Porting
+
+The variables ${PX4_SOURCE_DIR}, ${OS}, ${LABE} and ${BOARD} are passed by the build system.
+
+## Adding a New Board Config
+
+If the OS is currently supported, but you want to add a new board file, add the file to:
+```
+${PX4_SOURCE_DIR}/platforms/${OS}/boards/${BOARD}/config\_${LABEL}.cmake
+```
+
+You can create multiple config files for the same board (e.g config_test.cmake vs config_default.cmake).
+
+If you have a SoC platform that has a single board but multiple builds of PX4 for different processors, and there are shared board files, the ${BOARD_FILE_DIRS} should be set to point to the locations of the board files. If you use src/drivers/boards/common/board_config.h you should add ${PX4_SOURCE_DIR}/src/drivers/boards to ${BOARD_FILE_DIRS} and include "common/board_config.h" in your custom board_config.h.
+
+If not specified in the config file, ${BOARD_FILE_DIRS} defaults to:
+
+```
+set(BOARD_FILE_DIRS ${PX4_SOURCE_DIR}platforms/${OS}/src/drivers/boards/${BOARD} \
+ ${PX4_SOURCE_DIR}/src/drivers/boards)
+```
+
+The board_config.h file must go in:
+```
+${PX4_SOURCE_DIR}/platforms/${OS}/boards/${BOARD}
+```
+## Overriding a Driver or Module
+
+Drivers specified in the config file ${PX4_SOURCE_DIR}/platforms/${OS}/cmake/configs/${OS}\_${BOARD}_CONFIG will use an instance found in ${PX4_SOURCE_DIR}/platforms/${OS}/src/ before looking in src/. For instance, to override the src/drivers/rgbled driver for a new platform, you could create a ${PX4_SOURCE_DIR}/platforms/${OS}/src/drivers/rgbled directory with the modfified CMakeLists.txt and src code to implement the driver.
+
+## Adding New OS Platforms
+
+Platforms must provide the following
+
+* ${PX4_SOURCE_DIR}/platforms/${OS}/
+ - cmake/${OS}/px4_impl_${OS}.cmake
+ - src/firmware/${OS}/CMakeLists.txt
+
+and one or more supported boards:
+
+* ${PX4_SOURCE_DIR}/platforms/${OS}/
+ - boards/${BOARD}/config\_${LABEL}.cmake
+ - boards/${BOARD}/board_config.h
+
+and an implementation for the OS:
+
+* ${PX4_SOURCE_DIR}/platforms/${OS}/
+ - src/platforms/${OS}
+
diff --git a/Debug/NuttX b/platforms/nuttx/Debug/NuttX
similarity index 100%
rename from Debug/NuttX
rename to platforms/nuttx/Debug/NuttX
diff --git a/Debug/NuttX_BMP b/platforms/nuttx/Debug/NuttX_BMP
similarity index 100%
rename from Debug/NuttX_BMP
rename to platforms/nuttx/Debug/NuttX_BMP
diff --git a/Debug/Nuttx.py b/platforms/nuttx/Debug/Nuttx.py
similarity index 100%
rename from Debug/Nuttx.py
rename to platforms/nuttx/Debug/Nuttx.py
diff --git a/Debug/olimex-px4fmu-debug.cfg b/platforms/nuttx/Debug/olimex-px4fmu-debug.cfg
similarity index 100%
rename from Debug/olimex-px4fmu-debug.cfg
rename to platforms/nuttx/Debug/olimex-px4fmu-debug.cfg
diff --git a/Debug/px4fmu-v1-board.cfg b/platforms/nuttx/Debug/px4fmu-v1-board.cfg
similarity index 100%
rename from Debug/px4fmu-v1-board.cfg
rename to platforms/nuttx/Debug/px4fmu-v1-board.cfg
diff --git a/Images/aerocore.prototype b/platforms/nuttx/Images/aerocore.prototype
similarity index 100%
rename from Images/aerocore.prototype
rename to platforms/nuttx/Images/aerocore.prototype
diff --git a/Images/aerocore2.prototype b/platforms/nuttx/Images/aerocore2.prototype
similarity index 100%
rename from Images/aerocore2.prototype
rename to platforms/nuttx/Images/aerocore2.prototype
diff --git a/Images/aerofc-v1.prototype b/platforms/nuttx/Images/aerofc-v1.prototype
similarity index 100%
rename from Images/aerofc-v1.prototype
rename to platforms/nuttx/Images/aerofc-v1.prototype
diff --git a/Images/auav-x21.prototype b/platforms/nuttx/Images/auav-x21.prototype
similarity index 100%
rename from Images/auav-x21.prototype
rename to platforms/nuttx/Images/auav-x21.prototype
diff --git a/Images/crazyflie.prototype b/platforms/nuttx/Images/crazyflie.prototype
similarity index 100%
rename from Images/crazyflie.prototype
rename to platforms/nuttx/Images/crazyflie.prototype
diff --git a/Images/esc35-v1.prototype b/platforms/nuttx/Images/esc35-v1.prototype
similarity index 100%
rename from Images/esc35-v1.prototype
rename to platforms/nuttx/Images/esc35-v1.prototype
diff --git a/Images/mindpx-v2.prototype b/platforms/nuttx/Images/mindpx-v2.prototype
similarity index 100%
rename from Images/mindpx-v2.prototype
rename to platforms/nuttx/Images/mindpx-v2.prototype
diff --git a/Images/px4cannode-v1.prototype b/platforms/nuttx/Images/px4-cannode-v1.prototype
similarity index 100%
rename from Images/px4cannode-v1.prototype
rename to platforms/nuttx/Images/px4-cannode-v1.prototype
diff --git a/Images/px4esc-v1.prototype b/platforms/nuttx/Images/px4-esc-v1.prototype
similarity index 100%
rename from Images/px4esc-v1.prototype
rename to platforms/nuttx/Images/px4-esc-v1.prototype
diff --git a/Images/px4flow-v2.prototype b/platforms/nuttx/Images/px4-flow-v2.prototype
similarity index 100%
rename from Images/px4flow-v2.prototype
rename to platforms/nuttx/Images/px4-flow-v2.prototype
diff --git a/Images/px4fmu-v1.prototype b/platforms/nuttx/Images/px4-fmu-v1.prototype
similarity index 100%
rename from Images/px4fmu-v1.prototype
rename to platforms/nuttx/Images/px4-fmu-v1.prototype
diff --git a/Images/px4fmu-v2.prototype b/platforms/nuttx/Images/px4-fmu-v2.prototype
similarity index 100%
rename from Images/px4fmu-v2.prototype
rename to platforms/nuttx/Images/px4-fmu-v2.prototype
diff --git a/Images/px4fmu-v3.prototype b/platforms/nuttx/Images/px4-fmu-v3.prototype
similarity index 100%
rename from Images/px4fmu-v3.prototype
rename to platforms/nuttx/Images/px4-fmu-v3.prototype
diff --git a/Images/px4fmu-v4.prototype b/platforms/nuttx/Images/px4-fmu-v4.prototype
similarity index 100%
rename from Images/px4fmu-v4.prototype
rename to platforms/nuttx/Images/px4-fmu-v4.prototype
diff --git a/Images/px4fmu-v4pro.prototype b/platforms/nuttx/Images/px4-fmu-v4pro.prototype
similarity index 100%
rename from Images/px4fmu-v4pro.prototype
rename to platforms/nuttx/Images/px4-fmu-v4pro.prototype
diff --git a/Images/px4fmu-v5.prototype b/platforms/nuttx/Images/px4-fmu-v5.prototype
similarity index 100%
rename from Images/px4fmu-v5.prototype
rename to platforms/nuttx/Images/px4-fmu-v5.prototype
diff --git a/Images/px4io-v1.prototype b/platforms/nuttx/Images/px4-io-v1.prototype
similarity index 100%
rename from Images/px4io-v1.prototype
rename to platforms/nuttx/Images/px4-io-v1.prototype
diff --git a/Images/px4io-v2.prototype b/platforms/nuttx/Images/px4-io-v2.prototype
similarity index 100%
rename from Images/px4io-v2.prototype
rename to platforms/nuttx/Images/px4-io-v2.prototype
diff --git a/Images/px4nucleoF767ZI-v1.prototype b/platforms/nuttx/Images/px4-nucleoF767ZI-v1.prototype
similarity index 100%
rename from Images/px4nucleoF767ZI-v1.prototype
rename to platforms/nuttx/Images/px4-nucleoF767ZI-v1.prototype
diff --git a/Images/px4-stm32f4discovery.prototype b/platforms/nuttx/Images/px4-stm32f4discovery.prototype
similarity index 100%
rename from Images/px4-stm32f4discovery.prototype
rename to platforms/nuttx/Images/px4-stm32f4discovery.prototype
diff --git a/Images/s2740vc-v1.prototype b/platforms/nuttx/Images/s2740vc-v1.prototype
similarity index 100%
rename from Images/s2740vc-v1.prototype
rename to platforms/nuttx/Images/s2740vc-v1.prototype
diff --git a/Images/tap-v1.prototype b/platforms/nuttx/Images/tap-v1.prototype
similarity index 100%
rename from Images/tap-v1.prototype
rename to platforms/nuttx/Images/tap-v1.prototype
diff --git a/Images/zubaxgnss-v1.prototype b/platforms/nuttx/Images/zubaxgnss-v1.prototype
similarity index 100%
rename from Images/zubaxgnss-v1.prototype
rename to platforms/nuttx/Images/zubaxgnss-v1.prototype
diff --git a/NuttX b/platforms/nuttx/NuttX
similarity index 100%
rename from NuttX
rename to platforms/nuttx/NuttX
diff --git a/Tools/aero_upload.sh b/platforms/nuttx/Tools/aero_upload.sh
similarity index 100%
rename from Tools/aero_upload.sh
rename to platforms/nuttx/Tools/aero_upload.sh
diff --git a/Tools/new_nuttx_px_config.sh b/platforms/nuttx/Tools/new_nuttx_px_config.sh
similarity index 100%
rename from Tools/new_nuttx_px_config.sh
rename to platforms/nuttx/Tools/new_nuttx_px_config.sh
diff --git a/Tools/nuttx_defconf_tool.sh b/platforms/nuttx/Tools/nuttx_defconf_tool.sh
similarity index 100%
rename from Tools/nuttx_defconf_tool.sh
rename to platforms/nuttx/Tools/nuttx_defconf_tool.sh
diff --git a/platforms/nuttx/Tools/px_update_git_nuttx_header.py b/platforms/nuttx/Tools/px_update_git_nuttx_header.py
new file mode 100755
index 000000000000..4e254af44d85
--- /dev/null
+++ b/platforms/nuttx/Tools/px_update_git_nuttx_header.py
@@ -0,0 +1,39 @@
+#!/usr/bin/env python
+from __future__ import print_function
+
+import sys
+import subprocess
+import re
+
+filename = sys.argv[1]
+px4_source_dir = sys.argv[2]
+
+try:
+ fp_header = open(filename, 'r')
+ old_header = fp_header.read()
+except:
+ old_header = ''
+
+nuttx_git_tag = subprocess.check_output('git describe --always --tags --match nuttx-* --dirty'.split(),
+ cwd=px4_source_dir+'/platforms/nuttx/NuttX/nuttx', stderr=subprocess.STDOUT).decode('utf-8').strip().replace("nuttx-","v")
+nuttx_git_tag = re.sub('-.*','.0',nuttx_git_tag)
+nuttx_git_version = subprocess.check_output('git rev-parse --verify HEAD'.split(),
+ cwd=px4_source_dir+'/platforms/nuttx/NuttX/nuttx', stderr=subprocess.STDOUT).decode('utf-8').strip()
+nuttx_git_version_short = nuttx_git_version[0:16]
+
+# Generate the header file content
+header = """
+/* Auto Magically Generated file */
+/* Do not edit! */
+#pragma once
+#define NUTTX_GIT_VERSION_STR "{nuttx_git_version}"
+#define NUTTX_GIT_VERSION_BINARY 0x{nuttx_git_version_short}
+#define NUTTX_GIT_TAG_STR "{nuttx_git_tag}"
+""".format(nuttx_git_version=nuttx_git_version,
+ nuttx_git_version_short=nuttx_git_version_short,
+ nuttx_git_tag=nuttx_git_tag)
+
+if old_header != header:
+ print('Updating header {}'.format(sys.argv[1]))
+ fp_header = open(filename, 'w')
+ fp_header.write(header)
diff --git a/Tools/uavcan_copy.sh b/platforms/nuttx/Tools/uavcan_copy.sh
similarity index 100%
rename from Tools/uavcan_copy.sh
rename to platforms/nuttx/Tools/uavcan_copy.sh
diff --git a/cmake/configs/nuttx_aerocore2_default.cmake b/platforms/nuttx/boards/aerocore2/config_default.cmake
similarity index 96%
rename from cmake/configs/nuttx_aerocore2_default.cmake
rename to platforms/nuttx/boards/aerocore2/config_default.cmake
index 835b762c18c1..86d6f56eb29c 100644
--- a/cmake/configs/nuttx_aerocore2_default.cmake
+++ b/platforms/nuttx/boards/aerocore2/config_default.cmake
@@ -2,7 +2,7 @@ include(nuttx/px4_impl_nuttx)
px4_nuttx_configure(HWCLASS m4 CONFIG nsh ROMFS y ROMFSROOT px4fmu_common)
-set(CMAKE_TOOLCHAIN_FILE ${PX4_SOURCE_DIR}/cmake/toolchains/Toolchain-arm-none-eabi.cmake)
+set(CMAKE_TOOLCHAIN_FILE ${PX4_SOURCE_DIR}/platforms/nuttx/cmake/toolchains/Toolchain-arm-none-eabi.cmake)
set(config_uavcan_num_ifaces 2)
diff --git a/cmake/configs/nuttx_aerofc-v1_default.cmake b/platforms/nuttx/boards/aerofc-v1/config_default.cmake
similarity index 94%
rename from cmake/configs/nuttx_aerofc-v1_default.cmake
rename to platforms/nuttx/boards/aerofc-v1/config_default.cmake
index 446bc8ce564c..c607865394bc 100644
--- a/cmake/configs/nuttx_aerofc-v1_default.cmake
+++ b/platforms/nuttx/boards/aerofc-v1/config_default.cmake
@@ -2,7 +2,7 @@ include(nuttx/px4_impl_nuttx)
px4_nuttx_configure(HWCLASS m4 CONFIG nsh ROMFS y ROMFSROOT px4fmu_common)
-set(CMAKE_TOOLCHAIN_FILE ${PX4_SOURCE_DIR}/cmake/toolchains/Toolchain-arm-none-eabi.cmake)
+set(CMAKE_TOOLCHAIN_FILE ${PX4_SOURCE_DIR}/platforms/nuttx/cmake/toolchains/Toolchain-arm-none-eabi.cmake)
set(config_uavcan_num_ifaces 2)
diff --git a/src/drivers/boards/auav-x21/board_config.h b/platforms/nuttx/boards/auav-x21/board_config.h
similarity index 99%
rename from src/drivers/boards/auav-x21/board_config.h
rename to platforms/nuttx/boards/auav-x21/board_config.h
index 5e12a12b321a..6ba4f983a3cb 100644
--- a/src/drivers/boards/auav-x21/board_config.h
+++ b/platforms/nuttx/boards/auav-x21/board_config.h
@@ -299,7 +299,7 @@ extern void stm32_usbinitialize(void);
extern void stm32_spiinitialize(void);
-#include "../common/board_common.h"
+#include "common/board_common.h"
#endif /* __ASSEMBLY__ */
__END_DECLS
diff --git a/cmake/configs/nuttx_auav-x21_default.cmake b/platforms/nuttx/boards/auav-x21/config_default.cmake
similarity index 97%
rename from cmake/configs/nuttx_auav-x21_default.cmake
rename to platforms/nuttx/boards/auav-x21/config_default.cmake
index 29a042c16883..0cbb26b8d950 100644
--- a/cmake/configs/nuttx_auav-x21_default.cmake
+++ b/platforms/nuttx/boards/auav-x21/config_default.cmake
@@ -2,7 +2,7 @@ include(nuttx/px4_impl_nuttx)
px4_nuttx_configure(HWCLASS m4 CONFIG nsh ROMFS y ROMFSROOT px4fmu_common)
-set(CMAKE_TOOLCHAIN_FILE ${PX4_SOURCE_DIR}/cmake/toolchains/Toolchain-arm-none-eabi.cmake)
+set(CMAKE_TOOLCHAIN_FILE ${PX4_SOURCE_DIR}/platforms/nuttx/cmake/toolchains/Toolchain-arm-none-eabi.cmake)
set(config_uavcan_num_ifaces 1)
diff --git a/src/drivers/boards/crazyflie/board_config.h b/platforms/nuttx/boards/crazyflie/board_config.h
similarity index 99%
rename from src/drivers/boards/crazyflie/board_config.h
rename to platforms/nuttx/boards/crazyflie/board_config.h
index 1727c124bd3e..2aa82762534c 100644
--- a/src/drivers/boards/crazyflie/board_config.h
+++ b/platforms/nuttx/boards/crazyflie/board_config.h
@@ -232,7 +232,7 @@ extern void stm32_usbinitialize(void);
int board_i2c_initialize(void);
-#include "../common/board_common.h"
+#include "common/board_common.h"
#endif /* __ASSEMBLY__ */
diff --git a/cmake/configs/nuttx_crazyflie_default.cmake b/platforms/nuttx/boards/crazyflie/config_default.cmake
similarity index 96%
rename from cmake/configs/nuttx_crazyflie_default.cmake
rename to platforms/nuttx/boards/crazyflie/config_default.cmake
index b23784892a66..10f354983da7 100644
--- a/cmake/configs/nuttx_crazyflie_default.cmake
+++ b/platforms/nuttx/boards/crazyflie/config_default.cmake
@@ -2,7 +2,7 @@ include(nuttx/px4_impl_nuttx)
px4_nuttx_configure(HWCLASS m4 CONFIG nsh ROMFS y ROMFSROOT px4fmu_common)
-set(CMAKE_TOOLCHAIN_FILE ${PX4_SOURCE_DIR}/cmake/toolchains/Toolchain-arm-none-eabi.cmake)
+set(CMAKE_TOOLCHAIN_FILE ${PX4_SOURCE_DIR}/platforms/nuttx/cmake/toolchains/Toolchain-arm-none-eabi.cmake)
set(config_module_list
#
diff --git a/src/drivers/boards/esc35-v1/board_config.h b/platforms/nuttx/boards/esc35-v1/board_config.h
similarity index 99%
rename from src/drivers/boards/esc35-v1/board_config.h
rename to platforms/nuttx/boards/esc35-v1/board_config.h
index 63dedcc7a247..6b260723e736 100644
--- a/src/drivers/boards/esc35-v1/board_config.h
+++ b/platforms/nuttx/boards/esc35-v1/board_config.h
@@ -275,7 +275,7 @@ int usbmsc_archinitialize(void);
extern int composite_archinitialize(void);
#endif
-#include "../common/board_common.h"
+#include "common/board_common.h"
#endif /* __ASSEMBLY__ */
diff --git a/cmake/configs/nuttx_esc35-v1_bootloader.cmake b/platforms/nuttx/boards/esc35-v1/config_bootloader.cmake
similarity index 72%
rename from cmake/configs/nuttx_esc35-v1_bootloader.cmake
rename to platforms/nuttx/boards/esc35-v1/config_bootloader.cmake
index 9967758a66b8..4b8c8669bad5 100644
--- a/cmake/configs/nuttx_esc35-v1_bootloader.cmake
+++ b/platforms/nuttx/boards/esc35-v1/config_bootloader.cmake
@@ -3,7 +3,7 @@ include(nuttx/px4_impl_nuttx)
px4_nuttx_configure(HWCLASS m4 CONFIG bootloader)
set(px4_src_base ${CMAKE_SOURCE_DIR}/src/)
-set(px4_bootloader_base ${px4_src_base}drivers/bootloaders/)
+set(px4_bootloader_base ${CMAKE_SOURCE_DIR}/platforms/nuttx/src/drivers/bootloaders/)
set(px4_module_base ${px4_src_base}modules/)
#
@@ -15,7 +15,7 @@ set(px4_module_base ${px4_src_base}modules/)
include(configs/uavcan_board_ident/esc35-v1)
-set(CMAKE_TOOLCHAIN_FILE ${CMAKE_SOURCE_DIR}/cmake/toolchains/Toolchain-arm-none-eabi.cmake)
+set(CMAKE_TOOLCHAIN_FILE ${CMAKE_SOURCE_DIR}/platforms/nuttx/cmake/toolchains/Toolchain-arm-none-eabi.cmake)
set(config_module_list
diff --git a/cmake/configs/nuttx_esc35-v1_default.cmake b/platforms/nuttx/boards/esc35-v1/config_default.cmake
similarity index 94%
rename from cmake/configs/nuttx_esc35-v1_default.cmake
rename to platforms/nuttx/boards/esc35-v1/config_default.cmake
index b8a10fb25af7..91537bcdf2c9 100644
--- a/cmake/configs/nuttx_esc35-v1_default.cmake
+++ b/platforms/nuttx/boards/esc35-v1/config_default.cmake
@@ -29,7 +29,7 @@ px4_nuttx_make_uavcan_bootloadable(BOARD ${BOARD}
SW_MAJOR ${uavcanblid_sw_version_major}
SW_MINOR ${uavcanblid_sw_version_minor})
-set(CMAKE_TOOLCHAIN_FILE ${CMAKE_SOURCE_DIR}/cmake/toolchains/Toolchain-arm-none-eabi.cmake)
+set(CMAKE_TOOLCHAIN_FILE ${CMAKE_SOURCE_DIR}/platforms/nuttx/cmake/toolchains/Toolchain-arm-none-eabi.cmake)
set(config_module_list
diff --git a/src/drivers/boards/mindpx-v2/board_config.h b/platforms/nuttx/boards/mindpx-v2/board_config.h
similarity index 99%
rename from src/drivers/boards/mindpx-v2/board_config.h
rename to platforms/nuttx/boards/mindpx-v2/board_config.h
index 0d240d238619..4addce73186a 100644
--- a/src/drivers/boards/mindpx-v2/board_config.h
+++ b/platforms/nuttx/boards/mindpx-v2/board_config.h
@@ -375,7 +375,7 @@ extern void stm32_usbinitialize(void);
#define board_peripheral_reset(ms)
-#include "../common/board_common.h"
+#include "common/board_common.h"
#endif /* __ASSEMBLY__ */
diff --git a/cmake/configs/nuttx_mindpx-v2_default.cmake b/platforms/nuttx/boards/mindpx-v2/config_default.cmake
similarity index 97%
rename from cmake/configs/nuttx_mindpx-v2_default.cmake
rename to platforms/nuttx/boards/mindpx-v2/config_default.cmake
index 3fc342be42cc..8a0ecefa67ef 100644
--- a/cmake/configs/nuttx_mindpx-v2_default.cmake
+++ b/platforms/nuttx/boards/mindpx-v2/config_default.cmake
@@ -2,7 +2,7 @@ include(nuttx/px4_impl_nuttx)
px4_nuttx_configure(HWCLASS m4 CONFIG nsh ROMFS y ROMFSROOT px4fmu_common)
-set(CMAKE_TOOLCHAIN_FILE ${PX4_SOURCE_DIR}/cmake/toolchains/Toolchain-arm-none-eabi.cmake)
+set(CMAKE_TOOLCHAIN_FILE ${PX4_SOURCE_DIR}/platforms/nuttx/cmake/toolchains/Toolchain-arm-none-eabi.cmake)
set(config_uavcan_num_ifaces 1)
diff --git a/src/drivers/boards/px4cannode-v1/board_config.h b/platforms/nuttx/boards/px4/cannode-v1/board_config.h
similarity index 99%
rename from src/drivers/boards/px4cannode-v1/board_config.h
rename to platforms/nuttx/boards/px4/cannode-v1/board_config.h
index 496b0e5a87df..9b174f353cec 100644
--- a/src/drivers/boards/px4cannode-v1/board_config.h
+++ b/platforms/nuttx/boards/px4/cannode-v1/board_config.h
@@ -283,7 +283,7 @@ int usbmsc_archinitialize(void);
extern int composite_archinitialize(void);
#endif
-#include "../common/board_common.h"
+#include "common/board_common.h"
#endif /* __ASSEMBLY__ */
diff --git a/cmake/configs/nuttx_px4cannode-v1_bootloader.cmake b/platforms/nuttx/boards/px4/cannode-v1/config_bootloader.cmake
similarity index 72%
rename from cmake/configs/nuttx_px4cannode-v1_bootloader.cmake
rename to platforms/nuttx/boards/px4/cannode-v1/config_bootloader.cmake
index 687985c3de8d..eabdab1f7b51 100644
--- a/cmake/configs/nuttx_px4cannode-v1_bootloader.cmake
+++ b/platforms/nuttx/boards/px4/cannode-v1/config_bootloader.cmake
@@ -3,7 +3,7 @@ include(nuttx/px4_impl_nuttx)
px4_nuttx_configure(HWCLASS m3 CONFIG bootloader)
set(px4_src_base ${CMAKE_SOURCE_DIR}/src/)
-set(px4_bootloader_base ${px4_src_base}drivers/bootloaders/)
+set(px4_bootloader_base ${CMAKE_SOURCE_DIR}/platforms/nuttx/src/drivers/bootloaders/)
set(px4_module_base ${px4_src_base}modules/)
#
@@ -15,7 +15,7 @@ set(px4_module_base ${px4_src_base}modules/)
include(configs/uavcan_board_ident/px4cannode-v1)
-set(CMAKE_TOOLCHAIN_FILE ${CMAKE_SOURCE_DIR}/cmake/toolchains/Toolchain-arm-none-eabi.cmake)
+set(CMAKE_TOOLCHAIN_FILE ${CMAKE_SOURCE_DIR}/platforms/nuttx/cmake/toolchains/Toolchain-arm-none-eabi.cmake)
set(config_module_list
diff --git a/cmake/configs/nuttx_px4cannode-v1_default.cmake b/platforms/nuttx/boards/px4/cannode-v1/config_default.cmake
similarity index 85%
rename from cmake/configs/nuttx_px4cannode-v1_default.cmake
rename to platforms/nuttx/boards/px4/cannode-v1/config_default.cmake
index 73f476ab32bd..920d27c3e5ef 100644
--- a/cmake/configs/nuttx_px4cannode-v1_default.cmake
+++ b/platforms/nuttx/boards/px4/cannode-v1/config_default.cmake
@@ -20,14 +20,14 @@ set(uavcanblid_sw_version_minor 1)
include(configs/uavcan_board_ident/px4cannode-v1)
px4_nuttx_make_uavcan_bootloadable(BOARD ${BOARD}
- BIN ${CMAKE_CURRENT_BINARY_DIR}/src/firmware/nuttx/firmware_nuttx.bin
+ BIN ${CMAKE_CURRENT_BINARY_DIR}/platforms/nuttx/src/firmware/nuttx/firmware_nuttx.bin
HWNAME ${uavcanblid_name}
HW_MAJOR ${uavcanblid_hw_version_major}
HW_MINOR ${uavcanblid_hw_version_minor}
SW_MAJOR ${uavcanblid_sw_version_major}
SW_MINOR ${uavcanblid_sw_version_minor})
-set(CMAKE_TOOLCHAIN_FILE ${CMAKE_SOURCE_DIR}/cmake/toolchains/Toolchain-arm-none-eabi.cmake)
+set(CMAKE_TOOLCHAIN_FILE ${CMAKE_SOURCE_DIR}/platforms/nuttx/cmake/toolchains/Toolchain-arm-none-eabi.cmake)
set(config_module_list
diff --git a/src/drivers/boards/px4esc-v1/board_config.h b/platforms/nuttx/boards/px4/esc-v1/board_config.h
similarity index 99%
rename from src/drivers/boards/px4esc-v1/board_config.h
rename to platforms/nuttx/boards/px4/esc-v1/board_config.h
index 28b9d39cab03..61098c085c51 100644
--- a/src/drivers/boards/px4esc-v1/board_config.h
+++ b/platforms/nuttx/boards/px4/esc-v1/board_config.h
@@ -356,7 +356,7 @@ int usbmsc_archinitialize(void);
extern int composite_archinitialize(void);
#endif
-#include "../common/board_common.h"
+#include "common/board_common.h"
#endif /* __ASSEMBLY__ */
diff --git a/cmake/configs/nuttx_px4esc-v1_bootloader.cmake b/platforms/nuttx/boards/px4/esc-v1/config_bootloader.cmake
similarity index 72%
rename from cmake/configs/nuttx_px4esc-v1_bootloader.cmake
rename to platforms/nuttx/boards/px4/esc-v1/config_bootloader.cmake
index cf7c566afd02..068e4419a75b 100644
--- a/cmake/configs/nuttx_px4esc-v1_bootloader.cmake
+++ b/platforms/nuttx/boards/px4/esc-v1/config_bootloader.cmake
@@ -3,7 +3,7 @@ include(nuttx/px4_impl_nuttx)
px4_nuttx_configure(HWCLASS m4 CONFIG bootloader)
set(px4_src_base ${CMAKE_SOURCE_DIR}/src/)
-set(px4_bootloader_base ${px4_src_base}drivers/bootloaders/)
+set(px4_bootloader_base ${CMAKE_SOURCE_DIR}/platforms/nuttx/src/drivers/bootloaders/)
set(px4_module_base ${px4_src_base}modules/)
#
@@ -15,7 +15,7 @@ set(px4_module_base ${px4_src_base}modules/)
include(configs/uavcan_board_ident/px4esc-v1)
-set(CMAKE_TOOLCHAIN_FILE ${CMAKE_SOURCE_DIR}/cmake/toolchains/Toolchain-arm-none-eabi.cmake)
+set(CMAKE_TOOLCHAIN_FILE ${CMAKE_SOURCE_DIR}/platforms/nuttx/cmake/toolchains/Toolchain-arm-none-eabi.cmake)
set(config_module_list
diff --git a/cmake/configs/nuttx_px4esc-v1_default.cmake b/platforms/nuttx/boards/px4/esc-v1/config_default.cmake
similarity index 90%
rename from cmake/configs/nuttx_px4esc-v1_default.cmake
rename to platforms/nuttx/boards/px4/esc-v1/config_default.cmake
index e5414a493e4c..2ba63d4d588c 100644
--- a/cmake/configs/nuttx_px4esc-v1_default.cmake
+++ b/platforms/nuttx/boards/px4/esc-v1/config_default.cmake
@@ -22,14 +22,14 @@ set(uavcanblid_sw_version_minor 1)
include(configs/uavcan_board_ident/px4esc-v1)
px4_nuttx_make_uavcan_bootloadable(BOARD ${BOARD}
- BIN ${CMAKE_CURRENT_BINARY_DIR}/src/firmware/nuttx/firmware_nuttx.bin
+ BIN ${CMAKE_CURRENT_BINARY_DIR}/platforms/nuttx/src/firmware/nuttx/firmware_nuttx.bin
HWNAME ${uavcanblid_name}
HW_MAJOR ${uavcanblid_hw_version_major}
HW_MINOR ${uavcanblid_hw_version_minor}
SW_MAJOR ${uavcanblid_sw_version_major}
SW_MINOR ${uavcanblid_sw_version_minor})
-set(CMAKE_TOOLCHAIN_FILE ${CMAKE_SOURCE_DIR}/cmake/toolchains/Toolchain-arm-none-eabi.cmake)
+set(CMAKE_TOOLCHAIN_FILE ${CMAKE_SOURCE_DIR}/platforms/nuttx/cmake/toolchains/Toolchain-arm-none-eabi.cmake)
set(config_module_list
diff --git a/src/drivers/boards/px4flow-v2/board_config.h b/platforms/nuttx/boards/px4/flow-v2/board_config.h
similarity index 99%
rename from src/drivers/boards/px4flow-v2/board_config.h
rename to platforms/nuttx/boards/px4/flow-v2/board_config.h
index a9241548db72..280a5bca3b89 100644
--- a/src/drivers/boards/px4flow-v2/board_config.h
+++ b/platforms/nuttx/boards/px4/flow-v2/board_config.h
@@ -378,7 +378,7 @@ int usbmsc_archinitialize(void);
extern int composite_archinitialize(void);
#endif
-#include "../common/board_common.h"
+#include "common/board_common.h"
#endif /* __ASSEMBLY__ */
diff --git a/cmake/configs/nuttx_px4flow-v2_bootloader.cmake b/platforms/nuttx/boards/px4/flow-v2/config_bootloader.cmake
similarity index 72%
rename from cmake/configs/nuttx_px4flow-v2_bootloader.cmake
rename to platforms/nuttx/boards/px4/flow-v2/config_bootloader.cmake
index 6bcc9af25bff..90b7fa12da5d 100644
--- a/cmake/configs/nuttx_px4flow-v2_bootloader.cmake
+++ b/platforms/nuttx/boards/px4/flow-v2/config_bootloader.cmake
@@ -3,7 +3,7 @@ include(nuttx/px4_impl_nuttx)
px4_nuttx_configure(HWCLASS m4 CONFIG bootloader)
set(px4_src_base ${CMAKE_SOURCE_DIR}/src/)
-set(px4_bootloader_base ${px4_src_base}drivers/bootloaders/)
+set(px4_bootloader_base ${CMAKE_SOURCE_DIR}/platforms/nuttx/src/drivers/bootloaders/)
set(px4_module_base ${px4_src_base}modules/)
#
@@ -15,7 +15,7 @@ set(px4_module_base ${px4_src_base}modules/)
include(configs/uavcan_board_ident/px4flow-v2)
-set(CMAKE_TOOLCHAIN_FILE ${CMAKE_SOURCE_DIR}/cmake/toolchains/Toolchain-arm-none-eabi.cmake)
+set(CMAKE_TOOLCHAIN_FILE ${CMAKE_SOURCE_DIR}/platforms/nuttx/cmake/toolchains/Toolchain-arm-none-eabi.cmake)
set(config_module_list
diff --git a/src/drivers/boards/px4fmu-v1/board_config.h b/platforms/nuttx/boards/px4/fmu-v1/board_config.h
similarity index 99%
rename from src/drivers/boards/px4fmu-v1/board_config.h
rename to platforms/nuttx/boards/px4/fmu-v1/board_config.h
index c239610ce08f..74d278053f9f 100644
--- a/src/drivers/boards/px4fmu-v1/board_config.h
+++ b/platforms/nuttx/boards/px4/fmu-v1/board_config.h
@@ -272,7 +272,7 @@ extern void stm32_usbinitialize(void);
#define board_peripheral_reset(ms)
-#include "../common/board_common.h"
+#include "common/board_common.h"
#endif /* __ASSEMBLY__ */
diff --git a/cmake/configs/nuttx_px4fmu-v1_default.cmake b/platforms/nuttx/boards/px4/fmu-v1/config_default.cmake
similarity index 96%
rename from cmake/configs/nuttx_px4fmu-v1_default.cmake
rename to platforms/nuttx/boards/px4/fmu-v1/config_default.cmake
index a1565aeb6484..40b40c0d854d 100644
--- a/cmake/configs/nuttx_px4fmu-v1_default.cmake
+++ b/platforms/nuttx/boards/px4/fmu-v1/config_default.cmake
@@ -2,7 +2,7 @@ include(nuttx/px4_impl_nuttx)
px4_nuttx_configure(HWCLASS m4 CONFIG nsh ROMFS y ROMFSROOT px4fmu_common)
-set(CMAKE_TOOLCHAIN_FILE ${PX4_SOURCE_DIR}/cmake/toolchains/Toolchain-arm-none-eabi.cmake)
+set(CMAKE_TOOLCHAIN_FILE ${PX4_SOURCE_DIR}/platforms/nuttx/cmake/toolchains/Toolchain-arm-none-eabi.cmake)
set(config_module_list
#
diff --git a/src/drivers/boards/px4fmu-v2/board_config.h b/platforms/nuttx/boards/px4/fmu-v2/board_config.h
similarity index 99%
rename from src/drivers/boards/px4fmu-v2/board_config.h
rename to platforms/nuttx/boards/px4/fmu-v2/board_config.h
index a8e6099bb3e3..b4c2dad64d91 100644
--- a/src/drivers/boards/px4fmu-v2/board_config.h
+++ b/platforms/nuttx/boards/px4/fmu-v2/board_config.h
@@ -423,7 +423,7 @@ extern void board_peripheral_reset(int ms);
extern void stm32_usbinitialize(void);
-#include "../common/board_common.h"
+#include "common/board_common.h"
#endif /* __ASSEMBLY__ */
diff --git a/cmake/configs/nuttx_px4fmu-v2_default.cmake b/platforms/nuttx/boards/px4/fmu-v2/config_default.cmake
similarity index 97%
rename from cmake/configs/nuttx_px4fmu-v2_default.cmake
rename to platforms/nuttx/boards/px4/fmu-v2/config_default.cmake
index a72f82defec7..0d03bcc7283c 100644
--- a/cmake/configs/nuttx_px4fmu-v2_default.cmake
+++ b/platforms/nuttx/boards/px4/fmu-v2/config_default.cmake
@@ -2,7 +2,7 @@ include(nuttx/px4_impl_nuttx)
px4_nuttx_configure(HWCLASS m4 CONFIG nsh ROMFS y ROMFSROOT px4fmu_common)
-set(CMAKE_TOOLCHAIN_FILE ${PX4_SOURCE_DIR}/cmake/toolchains/Toolchain-arm-none-eabi.cmake)
+set(CMAKE_TOOLCHAIN_FILE ${PX4_SOURCE_DIR}/platforms/nuttx/cmake/toolchains/Toolchain-arm-none-eabi.cmake)
set(config_uavcan_num_ifaces 2)
diff --git a/cmake/configs/nuttx_px4fmu-v2_lpe.cmake b/platforms/nuttx/boards/px4/fmu-v2/config_lpe.cmake
similarity index 100%
rename from cmake/configs/nuttx_px4fmu-v2_lpe.cmake
rename to platforms/nuttx/boards/px4/fmu-v2/config_lpe.cmake
diff --git a/cmake/configs/nuttx_px4fmu-v2_test.cmake b/platforms/nuttx/boards/px4/fmu-v2/config_test.cmake
similarity index 97%
rename from cmake/configs/nuttx_px4fmu-v2_test.cmake
rename to platforms/nuttx/boards/px4/fmu-v2/config_test.cmake
index b0671952dfb1..a32af1bba35d 100644
--- a/cmake/configs/nuttx_px4fmu-v2_test.cmake
+++ b/platforms/nuttx/boards/px4/fmu-v2/config_test.cmake
@@ -2,7 +2,7 @@ include(nuttx/px4_impl_nuttx)
px4_nuttx_configure(HWCLASS m4 CONFIG nsh ROMFS y ROMFSROOT px4fmu_test)
-set(CMAKE_TOOLCHAIN_FILE ${PX4_SOURCE_DIR}/cmake/toolchains/Toolchain-arm-none-eabi.cmake)
+set(CMAKE_TOOLCHAIN_FILE ${PX4_SOURCE_DIR}/platforms/nuttx/cmake/toolchains/Toolchain-arm-none-eabi.cmake)
set(config_uavcan_num_ifaces 2)
diff --git a/src/drivers/boards/px4fmu-v3/board_config.h b/platforms/nuttx/boards/px4/fmu-v3/board_config.h
similarity index 99%
rename from src/drivers/boards/px4fmu-v3/board_config.h
rename to platforms/nuttx/boards/px4/fmu-v3/board_config.h
index 7ad19d72e081..78e62f7540e7 100644
--- a/src/drivers/boards/px4fmu-v3/board_config.h
+++ b/platforms/nuttx/boards/px4/fmu-v3/board_config.h
@@ -184,4 +184,4 @@
/*----------------------------------------------------------*/
/* FMUv2 PixhawkMini SPI chip selects and DRDY */
/*----------------------------------------------------------*/
-#include "../px4fmu-v2/board_config.h"
+#include "../fmu-v2/board_config.h"
diff --git a/cmake/configs/nuttx_px4fmu-v3_default.cmake b/platforms/nuttx/boards/px4/fmu-v3/config_default.cmake
similarity index 97%
rename from cmake/configs/nuttx_px4fmu-v3_default.cmake
rename to platforms/nuttx/boards/px4/fmu-v3/config_default.cmake
index 2899078dd5a2..d0064ef65de2 100644
--- a/cmake/configs/nuttx_px4fmu-v3_default.cmake
+++ b/platforms/nuttx/boards/px4/fmu-v3/config_default.cmake
@@ -2,7 +2,7 @@ include(nuttx/px4_impl_nuttx)
px4_nuttx_configure(HWCLASS m4 CONFIG nsh ROMFS y ROMFSROOT px4fmu_common)
-set(CMAKE_TOOLCHAIN_FILE ${PX4_SOURCE_DIR}/cmake/toolchains/Toolchain-arm-none-eabi.cmake)
+set(CMAKE_TOOLCHAIN_FILE ${PX4_SOURCE_DIR}/platforms/nuttx/cmake/toolchains/Toolchain-arm-none-eabi.cmake)
set(config_uavcan_num_ifaces 2)
diff --git a/src/drivers/boards/px4fmu-v4/board_config.h b/platforms/nuttx/boards/px4/fmu-v4/board_config.h
similarity index 99%
rename from src/drivers/boards/px4fmu-v4/board_config.h
rename to platforms/nuttx/boards/px4/fmu-v4/board_config.h
index 17987c415d8f..5969dba33573 100644
--- a/src/drivers/boards/px4fmu-v4/board_config.h
+++ b/platforms/nuttx/boards/px4/fmu-v4/board_config.h
@@ -385,7 +385,7 @@ extern void stm32_usbinitialize(void);
extern void board_peripheral_reset(int ms);
-#include "../common/board_common.h"
+#include "common/board_common.h"
#endif /* __ASSEMBLY__ */
diff --git a/cmake/configs/nuttx_px4fmu-v4_default.cmake b/platforms/nuttx/boards/px4/fmu-v4/config_default.cmake
similarity index 97%
rename from cmake/configs/nuttx_px4fmu-v4_default.cmake
rename to platforms/nuttx/boards/px4/fmu-v4/config_default.cmake
index 61362f90dd77..eff26f82a1cf 100644
--- a/cmake/configs/nuttx_px4fmu-v4_default.cmake
+++ b/platforms/nuttx/boards/px4/fmu-v4/config_default.cmake
@@ -2,7 +2,7 @@ include(nuttx/px4_impl_nuttx)
px4_nuttx_configure(HWCLASS m4 CONFIG nsh ROMFS y ROMFSROOT px4fmu_common)
-set(CMAKE_TOOLCHAIN_FILE ${PX4_SOURCE_DIR}/cmake/toolchains/Toolchain-arm-none-eabi.cmake)
+set(CMAKE_TOOLCHAIN_FILE ${PX4_SOURCE_DIR}/platforms/nuttx/cmake/toolchains/Toolchain-arm-none-eabi.cmake)
set(config_uavcan_num_ifaces 1)
diff --git a/src/drivers/boards/px4fmu-v4pro/board_config.h b/platforms/nuttx/boards/px4/fmu-v4pro/board_config.h
similarity index 99%
rename from src/drivers/boards/px4fmu-v4pro/board_config.h
rename to platforms/nuttx/boards/px4/fmu-v4pro/board_config.h
index 29cea374950f..2933199fb987 100644
--- a/src/drivers/boards/px4fmu-v4pro/board_config.h
+++ b/platforms/nuttx/boards/px4/fmu-v4pro/board_config.h
@@ -418,7 +418,7 @@ extern void board_peripheral_reset(int ms);
int nsh_archinitialize(void);
#endif
-#include "../common/board_common.h"
+#include "common/board_common.h"
#endif /* __ASSEMBLY__ */
diff --git a/cmake/configs/nuttx_px4fmu-v4pro_default.cmake b/platforms/nuttx/boards/px4/fmu-v4pro/config_default.cmake
similarity index 97%
rename from cmake/configs/nuttx_px4fmu-v4pro_default.cmake
rename to platforms/nuttx/boards/px4/fmu-v4pro/config_default.cmake
index 07c743452526..10a4f507f709 100644
--- a/cmake/configs/nuttx_px4fmu-v4pro_default.cmake
+++ b/platforms/nuttx/boards/px4/fmu-v4pro/config_default.cmake
@@ -2,7 +2,7 @@ include(nuttx/px4_impl_nuttx)
px4_nuttx_configure(HWCLASS m4 CONFIG nsh ROMFS y ROMFSROOT px4fmu_common)
-set(CMAKE_TOOLCHAIN_FILE ${PX4_SOURCE_DIR}/cmake/toolchains/Toolchain-arm-none-eabi.cmake)
+set(CMAKE_TOOLCHAIN_FILE ${PX4_SOURCE_DIR}/platforms/nuttx/cmake/toolchains/Toolchain-arm-none-eabi.cmake)
set(config_uavcan_num_ifaces 2)
diff --git a/src/drivers/boards/px4fmu-v5/board_config.h b/platforms/nuttx/boards/px4/fmu-v5/board_config.h
similarity index 99%
rename from src/drivers/boards/px4fmu-v5/board_config.h
rename to platforms/nuttx/boards/px4/fmu-v5/board_config.h
index ea787bfa4f0b..86232e38d24c 100644
--- a/src/drivers/boards/px4fmu-v5/board_config.h
+++ b/platforms/nuttx/boards/px4/fmu-v5/board_config.h
@@ -762,7 +762,7 @@ extern void board_peripheral_reset(int ms);
int nsh_archinitialize(void);
#endif
-#include "../common/board_common.h"
+#include "common/board_common.h"
#endif /* __ASSEMBLY__ */
diff --git a/cmake/configs/nuttx_px4fmu-v5_default.cmake b/platforms/nuttx/boards/px4/fmu-v5/config_default.cmake
similarity index 97%
rename from cmake/configs/nuttx_px4fmu-v5_default.cmake
rename to platforms/nuttx/boards/px4/fmu-v5/config_default.cmake
index ec7639cddf4d..44acc173af4c 100644
--- a/cmake/configs/nuttx_px4fmu-v5_default.cmake
+++ b/platforms/nuttx/boards/px4/fmu-v5/config_default.cmake
@@ -2,7 +2,7 @@ include(nuttx/px4_impl_nuttx)
px4_nuttx_configure(HWCLASS m7 CONFIG nsh ROMFS y ROMFSROOT px4fmu_common)
-set(CMAKE_TOOLCHAIN_FILE ${PX4_SOURCE_DIR}/cmake/toolchains/Toolchain-arm-none-eabi.cmake)
+set(CMAKE_TOOLCHAIN_FILE ${PX4_SOURCE_DIR}/platforms/nuttx/cmake/toolchains/Toolchain-arm-none-eabi.cmake)
set(config_uavcan_num_ifaces 2)
diff --git a/src/drivers/boards/px4nucleoF767ZI-v1/board_config.h b/platforms/nuttx/boards/px4/nucleoF767ZI-v1/board_config.h
similarity index 99%
rename from src/drivers/boards/px4nucleoF767ZI-v1/board_config.h
rename to platforms/nuttx/boards/px4/nucleoF767ZI-v1/board_config.h
index a4a2dbf9a092..6ea3b706990c 100644
--- a/src/drivers/boards/px4nucleoF767ZI-v1/board_config.h
+++ b/platforms/nuttx/boards/px4/nucleoF767ZI-v1/board_config.h
@@ -423,7 +423,7 @@ extern void board_peripheral_reset(int ms);
extern void stm32_usbinitialize(void);
-#include "../common/board_common.h"
+#include "common/board_common.h"
#endif /* __ASSEMBLY__ */
diff --git a/cmake/configs/nuttx_px4nucleoF767ZI-v1_default.cmake b/platforms/nuttx/boards/px4/nucleoF767ZI-v1/config_default.cmake
similarity index 96%
rename from cmake/configs/nuttx_px4nucleoF767ZI-v1_default.cmake
rename to platforms/nuttx/boards/px4/nucleoF767ZI-v1/config_default.cmake
index 6f2a1f45703b..ddf1a861e3fd 100644
--- a/cmake/configs/nuttx_px4nucleoF767ZI-v1_default.cmake
+++ b/platforms/nuttx/boards/px4/nucleoF767ZI-v1/config_default.cmake
@@ -2,7 +2,7 @@ include(nuttx/px4_impl_nuttx)
px4_nuttx_configure(HWCLASS m7 CONFIG nsh ROMFS y ROMFSROOT px4fmu_common)
-set(CMAKE_TOOLCHAIN_FILE ${PX4_SOURCE_DIR}/cmake/toolchains/Toolchain-arm-none-eabi.cmake)
+set(CMAKE_TOOLCHAIN_FILE ${PX4_SOURCE_DIR}/platforms/nuttx/cmake/toolchains/Toolchain-arm-none-eabi.cmake)
set(config_uavcan_num_ifaces 2)
diff --git a/src/drivers/boards/px4-stm32f4discovery/board_config.h b/platforms/nuttx/boards/px4/stm32f4discovery/board_config.h
similarity index 99%
rename from src/drivers/boards/px4-stm32f4discovery/board_config.h
rename to platforms/nuttx/boards/px4/stm32f4discovery/board_config.h
index ba2fea7c62bb..7ecda792e7e8 100644
--- a/src/drivers/boards/px4-stm32f4discovery/board_config.h
+++ b/platforms/nuttx/boards/px4/stm32f4discovery/board_config.h
@@ -117,7 +117,7 @@ extern void stm32_spiinitialize(void);
extern void stm32_usbinitialize(void);
-#include "../common/board_common.h"
+#include "common/board_common.h"
#endif /* __ASSEMBLY__ */
diff --git a/cmake/configs/nuttx_px4-stm32f4discovery_default.cmake b/platforms/nuttx/boards/px4/stm32f4discovery/config_default.cmake
similarity index 93%
rename from cmake/configs/nuttx_px4-stm32f4discovery_default.cmake
rename to platforms/nuttx/boards/px4/stm32f4discovery/config_default.cmake
index 74b38b787a6a..2adc0dc22567 100644
--- a/cmake/configs/nuttx_px4-stm32f4discovery_default.cmake
+++ b/platforms/nuttx/boards/px4/stm32f4discovery/config_default.cmake
@@ -2,7 +2,7 @@ include(nuttx/px4_impl_nuttx)
px4_nuttx_configure(HWCLASS m4 CONFIG nsh ROMFS y ROMFSROOT px4fmu_common)
-set(CMAKE_TOOLCHAIN_FILE ${PX4_SOURCE_DIR}/cmake/toolchains/Toolchain-arm-none-eabi.cmake)
+set(CMAKE_TOOLCHAIN_FILE ${PX4_SOURCE_DIR}/platforms/nuttx/cmake/toolchains/Toolchain-arm-none-eabi.cmake)
set(config_module_list
#
diff --git a/src/drivers/boards/s2740vc-v1/board_config.h b/platforms/nuttx/boards/s2740vc-v1/board_config.h
similarity index 99%
rename from src/drivers/boards/s2740vc-v1/board_config.h
rename to platforms/nuttx/boards/s2740vc-v1/board_config.h
index bd5ae893a73a..e25c9fdcf869 100644
--- a/src/drivers/boards/s2740vc-v1/board_config.h
+++ b/platforms/nuttx/boards/s2740vc-v1/board_config.h
@@ -126,7 +126,7 @@ int board_can_initialize(void);
extern int composite_archinitialize(void);
#endif
-#include "../common/board_common.h"
+#include "common/board_common.h"
#endif /* __ASSEMBLY__ */
diff --git a/cmake/configs/nuttx_s2740vc-v1_bootloader.cmake b/platforms/nuttx/boards/s2740vc-v1/config_bootloader.cmake
similarity index 72%
rename from cmake/configs/nuttx_s2740vc-v1_bootloader.cmake
rename to platforms/nuttx/boards/s2740vc-v1/config_bootloader.cmake
index 4497e588f8f4..07ade01e599f 100644
--- a/cmake/configs/nuttx_s2740vc-v1_bootloader.cmake
+++ b/platforms/nuttx/boards/s2740vc-v1/config_bootloader.cmake
@@ -3,7 +3,7 @@ include(nuttx/px4_impl_nuttx)
px4_nuttx_configure(HWCLASS m4 CONFIG bootloader)
set(px4_src_base ${CMAKE_SOURCE_DIR}/src/)
-set(px4_bootloader_base ${px4_src_base}drivers/bootloaders/)
+set(px4_bootloader_base ${CMAKE_SOURCE_DIR}/platforms/nuttx/src/drivers/bootloaders/)
set(px4_module_base ${px4_src_base}modules/)
#
@@ -15,7 +15,7 @@ set(px4_module_base ${px4_src_base}modules/)
include(configs/uavcan_board_ident/s2740vc-v1)
-set(CMAKE_TOOLCHAIN_FILE ${CMAKE_SOURCE_DIR}/cmake/toolchains/Toolchain-arm-none-eabi.cmake)
+set(CMAKE_TOOLCHAIN_FILE ${CMAKE_SOURCE_DIR}/platforms/nuttx/cmake/toolchains/Toolchain-arm-none-eabi.cmake)
set(config_module_list
diff --git a/cmake/configs/nuttx_s2740vc-v1_default.cmake b/platforms/nuttx/boards/s2740vc-v1/config_default.cmake
similarity index 91%
rename from cmake/configs/nuttx_s2740vc-v1_default.cmake
rename to platforms/nuttx/boards/s2740vc-v1/config_default.cmake
index bd2a577e3f77..45a2a9241898 100644
--- a/cmake/configs/nuttx_s2740vc-v1_default.cmake
+++ b/platforms/nuttx/boards/s2740vc-v1/config_default.cmake
@@ -28,7 +28,7 @@ include(configs/uavcan_board_ident/s2740vc-v1)
# SW_MAJOR ${uavcanblid_sw_version_major}
# SW_MINOR ${uavcanblid_sw_version_minor})
-set(CMAKE_TOOLCHAIN_FILE ${CMAKE_SOURCE_DIR}/cmake/toolchains/Toolchain-arm-none-eabi.cmake)
+set(CMAKE_TOOLCHAIN_FILE ${CMAKE_SOURCE_DIR}/platforms/nuttx/cmake/toolchains/Toolchain-arm-none-eabi.cmake)
set(config_module_list
diff --git a/src/drivers/boards/tap-v1/board_config.h b/platforms/nuttx/boards/tap-v1/board_config.h
similarity index 99%
rename from src/drivers/boards/tap-v1/board_config.h
rename to platforms/nuttx/boards/tap-v1/board_config.h
index 130d9d7a28f5..0934a7cbad3e 100644
--- a/src/drivers/boards/tap-v1/board_config.h
+++ b/platforms/nuttx/boards/tap-v1/board_config.h
@@ -347,7 +347,7 @@ void board_pwr_init(int stage);
bool board_pwr_button_down(void);
-#include "../common/board_common.h"
+#include "common/board_common.h"
#endif /* __ASSEMBLY__ */
diff --git a/cmake/configs/nuttx_tap-v1_default.cmake b/platforms/nuttx/boards/tap-v1/config_default.cmake
similarity index 95%
rename from cmake/configs/nuttx_tap-v1_default.cmake
rename to platforms/nuttx/boards/tap-v1/config_default.cmake
index 2e3e24ed4012..ec2bd365b151 100644
--- a/cmake/configs/nuttx_tap-v1_default.cmake
+++ b/platforms/nuttx/boards/tap-v1/config_default.cmake
@@ -2,7 +2,7 @@ include(nuttx/px4_impl_nuttx)
px4_nuttx_configure(HWCLASS m4 CONFIG nsh ROMFS y ROMFSROOT tap_common)
-set(CMAKE_TOOLCHAIN_FILE ${PX4_SOURCE_DIR}/cmake/toolchains/Toolchain-arm-none-eabi.cmake)
+set(CMAKE_TOOLCHAIN_FILE ${PX4_SOURCE_DIR}/platforms/nuttx/cmake/toolchains/Toolchain-arm-none-eabi.cmake)
set(target_definitions MEMORY_CONSTRAINED_SYSTEM)
diff --git a/src/drivers/boards/zubaxgnss-v1/board_config.h b/platforms/nuttx/boards/zubaxgnss-v1/board_config.h
similarity index 99%
rename from src/drivers/boards/zubaxgnss-v1/board_config.h
rename to platforms/nuttx/boards/zubaxgnss-v1/board_config.h
index d0fe26efaf8e..45d784990011 100644
--- a/src/drivers/boards/zubaxgnss-v1/board_config.h
+++ b/platforms/nuttx/boards/zubaxgnss-v1/board_config.h
@@ -240,7 +240,7 @@ int usbmsc_archinitialize(void);
extern int composite_archinitialize(void);
#endif
-#include "../common/board_common.h"
+#include "common/board_common.h"
#endif /* __ASSEMBLY__ */
diff --git a/cmake/configs/nuttx_zubaxgnss-v1_bootloader.cmake b/platforms/nuttx/boards/zubaxgnss-v1/config_bootloader.cmake
similarity index 72%
rename from cmake/configs/nuttx_zubaxgnss-v1_bootloader.cmake
rename to platforms/nuttx/boards/zubaxgnss-v1/config_bootloader.cmake
index 76a670bdb1a6..7654d2417ed0 100644
--- a/cmake/configs/nuttx_zubaxgnss-v1_bootloader.cmake
+++ b/platforms/nuttx/boards/zubaxgnss-v1/config_bootloader.cmake
@@ -3,7 +3,7 @@ include(nuttx/px4_impl_nuttx)
px4_nuttx_configure(HWCLASS m3 CONFIG bootloader)
set(px4_src_base ${CMAKE_SOURCE_DIR}/src/)
-set(px4_bootloader_base ${px4_src_base}drivers/bootloaders/)
+set(px4_bootloader_base ${CMAKE_SOURCE_DIR}/platforms/nuttx/src/drivers/bootloaders/)
set(px4_module_base ${px4_src_base}modules/)
#
@@ -15,7 +15,7 @@ set(px4_module_base ${px4_src_base}modules/)
include(configs/uavcan_board_ident/zubaxgnss-v1)
-set(CMAKE_TOOLCHAIN_FILE ${CMAKE_SOURCE_DIR}/cmake/toolchains/Toolchain-arm-none-eabi.cmake)
+set(CMAKE_TOOLCHAIN_FILE ${CMAKE_SOURCE_DIR}/platforms/nuttx/cmake/toolchains/Toolchain-arm-none-eabi.cmake)
set(config_module_list
diff --git a/cmake/configs/uavcan_board_ident/esc35-v1.cmake b/platforms/nuttx/cmake/configs/uavcan_board_ident/esc35-v1.cmake
similarity index 100%
rename from cmake/configs/uavcan_board_ident/esc35-v1.cmake
rename to platforms/nuttx/cmake/configs/uavcan_board_ident/esc35-v1.cmake
diff --git a/cmake/configs/uavcan_board_ident/px4cannode-v1.cmake b/platforms/nuttx/cmake/configs/uavcan_board_ident/px4cannode-v1.cmake
similarity index 100%
rename from cmake/configs/uavcan_board_ident/px4cannode-v1.cmake
rename to platforms/nuttx/cmake/configs/uavcan_board_ident/px4cannode-v1.cmake
diff --git a/cmake/configs/uavcan_board_ident/px4esc-v1.cmake b/platforms/nuttx/cmake/configs/uavcan_board_ident/px4esc-v1.cmake
similarity index 100%
rename from cmake/configs/uavcan_board_ident/px4esc-v1.cmake
rename to platforms/nuttx/cmake/configs/uavcan_board_ident/px4esc-v1.cmake
diff --git a/cmake/configs/uavcan_board_ident/px4flow-v2.cmake b/platforms/nuttx/cmake/configs/uavcan_board_ident/px4flow-v2.cmake
similarity index 100%
rename from cmake/configs/uavcan_board_ident/px4flow-v2.cmake
rename to platforms/nuttx/cmake/configs/uavcan_board_ident/px4flow-v2.cmake
diff --git a/cmake/configs/uavcan_board_ident/s2740vc-v1.cmake b/platforms/nuttx/cmake/configs/uavcan_board_ident/s2740vc-v1.cmake
similarity index 100%
rename from cmake/configs/uavcan_board_ident/s2740vc-v1.cmake
rename to platforms/nuttx/cmake/configs/uavcan_board_ident/s2740vc-v1.cmake
diff --git a/cmake/configs/uavcan_board_ident/zubaxgnss-v1.cmake b/platforms/nuttx/cmake/configs/uavcan_board_ident/zubaxgnss-v1.cmake
similarity index 100%
rename from cmake/configs/uavcan_board_ident/zubaxgnss-v1.cmake
rename to platforms/nuttx/cmake/configs/uavcan_board_ident/zubaxgnss-v1.cmake
diff --git a/cmake/nuttx/bin_to_obj.py b/platforms/nuttx/cmake/nuttx/bin_to_obj.py
similarity index 100%
rename from cmake/nuttx/bin_to_obj.py
rename to platforms/nuttx/cmake/nuttx/bin_to_obj.py
diff --git a/cmake/nuttx/builtin_commands.c.in b/platforms/nuttx/cmake/nuttx/builtin_commands.c.in
similarity index 100%
rename from cmake/nuttx/builtin_commands.c.in
rename to platforms/nuttx/cmake/nuttx/builtin_commands.c.in
diff --git a/cmake/nuttx/px4_impl_nuttx.cmake b/platforms/nuttx/cmake/nuttx/px4_impl_nuttx.cmake
similarity index 93%
rename from cmake/nuttx/px4_impl_nuttx.cmake
rename to platforms/nuttx/cmake/nuttx/px4_impl_nuttx.cmake
index d9b943c74332..ee2869568a16 100644
--- a/cmake/nuttx/px4_impl_nuttx.cmake
+++ b/platforms/nuttx/cmake/nuttx/px4_impl_nuttx.cmake
@@ -99,7 +99,7 @@ function(px4_nuttx_add_firmware)
add_custom_command(OUTPUT ${OUT} ${EXE}.bin
COMMAND ${OBJCOPY} -O binary ${EXE} ${EXE}.bin
COMMAND ${PYTHON_EXECUTABLE} ${PX4_SOURCE_DIR}/Tools/px_mkfw.py
- --prototype ${PX4_SOURCE_DIR}/Images/${BOARD}.prototype
+ --prototype ${PX4_SOURCE_DIR}/platforms/nuttx/Images/${BOARD}.prototype
--git_identity ${PX4_SOURCE_DIR}
${extra_args}
--image ${EXE}.bin > ${OUT}
@@ -215,7 +215,7 @@ function(px4_nuttx_generate_builtin_commands)
math(EXPR command_count "${command_count}+1")
endif()
endforeach()
- configure_file(${PX4_SOURCE_DIR}/cmake/nuttx/builtin_commands.c.in
+ configure_file(${PX4_SOURCE_DIR}/platforms/nuttx/cmake/nuttx/builtin_commands.c.in
${OUT})
endfunction()
@@ -263,7 +263,7 @@ function(px4_nuttx_add_export)
endif()
# nuttx-patches
- add_subdirectory(${PX4_SOURCE_DIR}/nuttx-patches ${PX4_BINARY_DIR}/${CONFIG})
+ add_subdirectory(${PX4_SOURCE_DIR}/platforms/nuttx/nuttx-patches ${PX4_BINARY_DIR}/${CONFIG})
set(nuttx_build_src ${PX4_BINARY_DIR}/${CONFIG}/NuttX)
set(nuttx_export_dir ${nuttx_build_src}/nuttx/nuttx-export)
@@ -274,8 +274,8 @@ function(px4_nuttx_add_export)
set(nuttx_export_stamp ${PX4_BINARY_DIR}/${CONFIG}/nuttx_export.stamp)
# copy
- file(GLOB_RECURSE nuttx_all_files ${PX4_SOURCE_DIR}/NuttX/*)
- file(RELATIVE_PATH nuttx_cp_src ${PX4_BINARY_DIR} ${PX4_SOURCE_DIR}/NuttX)
+ file(GLOB_RECURSE nuttx_all_files ${PX4_SOURCE_DIR}/platforms/nuttx/NuttX/*)
+ file(RELATIVE_PATH nuttx_cp_src ${PX4_BINARY_DIR} ${PX4_SOURCE_DIR}/platforms/nuttx/NuttX)
add_custom_command(OUTPUT ${nuttx_copy_stamp}
COMMAND ${MKDIR} -p ${nuttx_build_src}
COMMAND rsync -rp --inplace --delete --exclude=.git --exclude=nuttx-export ${nuttx_cp_src}/ ${CONFIG}/NuttX/
@@ -306,7 +306,7 @@ function(px4_nuttx_add_export)
# Read defconfig to see if CONFIG_ARMV7M_STACKCHECK is yes
# note: CONFIG will be BOARD in the future evaluation of ${hw_stack_check_${CONFIG}
- file(STRINGS "${PX4_SOURCE_DIR}/nuttx-configs/${CONFIG}/${config_nuttx_config}/defconfig"
+ file(STRINGS "${PX4_SOURCE_DIR}/platforms/nuttx/nuttx-configs/${CONFIG}/${config_nuttx_config}/defconfig"
hw_stack_check_${CONFIG}
REGEX "CONFIG_ARMV7M_STACKCHECK=y"
)
@@ -315,10 +315,10 @@ function(px4_nuttx_add_export)
endif()
# nuttx configure
- file(GLOB_RECURSE nuttx-configs ${PX4_SOURCE_DIR}/nuttx-configs/${CONFIG}/*)
+ file(GLOB_RECURSE nuttx-configs ${PX4_SOURCE_DIR}/platforms/nuttx/nuttx-configs/${CONFIG}/*)
add_custom_command(OUTPUT ${nuttx_configure_stamp} ${nuttx_build_src}/nuttx/.config
- COMMAND ${CP} -rp ${PX4_SOURCE_DIR}/nuttx-configs/*.mk ${nuttx_build_src}/nuttx/
- COMMAND ${CP} -rp ${PX4_SOURCE_DIR}/nuttx-configs/${CONFIG} ${nuttx_build_src}/nuttx/configs
+ COMMAND ${CP} -rp ${PX4_SOURCE_DIR}/platforms/nuttx/nuttx-configs/*.mk ${nuttx_build_src}/nuttx/
+ COMMAND ${CP} -rp ${PX4_SOURCE_DIR}/platforms/nuttx/nuttx-configs/${CONFIG} ${nuttx_build_src}/nuttx/configs
COMMAND cd ${nuttx_build_src}/nuttx/tools && sh configure.sh ${CONFIG}/${config_nuttx_config}
COMMAND cmake -E touch ${nuttx_configure_stamp}
DEPENDS nuttx_patch_${CONFIG} ${nuttx-configs}
@@ -329,8 +329,8 @@ function(px4_nuttx_add_export)
# manual nuttx oldconfig helper
add_custom_target(oldconfig_${CONFIG}
COMMAND ${MAKE} --no-print-directory -C ${nuttx_build_src}/nuttx CONFIG_ARCH_BOARD=${CONFIG} oldconfig
- COMMAND ${CP} ${nuttx_build_src}/nuttx/.config ${PX4_SOURCE_DIR}/nuttx-configs/${CONFIG}/${config_nuttx_config}/defconfig
- COMMAND ${PX4_SOURCE_DIR}/Tools/nuttx_defconf_tool.sh ${PX4_SOURCE_DIR}/nuttx-configs/${CONFIG}/${config_nuttx_config}/defconfig
+ COMMAND ${CP} ${nuttx_build_src}/nuttx/.config ${PX4_SOURCE_DIR}/platforms/nuttx/nuttx-configs/${CONFIG}/${config_nuttx_config}/defconfig
+ COMMAND ${PX4_SOURCE_DIR}/platforms/nuttx/Tools/nuttx_defconf_tool.sh ${PX4_SOURCE_DIR}/platforms/nuttx/nuttx-configs/${CONFIG}/${config_nuttx_config}/defconfig
DEPENDS nuttx_configure_${CONFIG}
WORKING_DIRECTORY ${nuttx_build_src}/nuttx
COMMENT "Running NuttX make oldconfig for ${CONFIG} with ${config_nuttx_config}"
@@ -339,8 +339,8 @@ function(px4_nuttx_add_export)
# manual nuttx menuconfig helper
add_custom_target(menuconfig_${CONFIG}
COMMAND ${MAKE} --no-print-directory -C ${nuttx_build_src}/nuttx CONFIG_ARCH_BOARD=${CONFIG} menuconfig
- COMMAND ${CP} ${nuttx_build_src}/nuttx/.config ${PX4_SOURCE_DIR}/nuttx-configs/${CONFIG}/${config_nuttx_config}/defconfig
- COMMAND ${PX4_SOURCE_DIR}/Tools/nuttx_defconf_tool.sh ${PX4_SOURCE_DIR}/nuttx-configs/${CONFIG}/${config_nuttx_config}/defconfig
+ COMMAND ${CP} ${nuttx_build_src}/nuttx/.config ${PX4_SOURCE_DIR}/platforms/nuttx/nuttx-configs/${CONFIG}/${config_nuttx_config}/defconfig
+ COMMAND ${PX4_SOURCE_DIR}/platforms/nuttx/Tools/nuttx_defconf_tool.sh ${PX4_SOURCE_DIR}/platforms/nuttx/nuttx-configs/${CONFIG}/${config_nuttx_config}/defconfig
DEPENDS nuttx_configure_${CONFIG}
WORKING_DIRECTORY ${nuttx_build_src}/nuttx
COMMENT "Running NuttX make menuconfig for ${CONFIG} with ${config_nuttx_config}"
@@ -438,7 +438,7 @@ function(px4_nuttx_add_romfs)
set(romfs_src_dir ${PX4_SOURCE_DIR}/${ROOT})
set(romfs_autostart ${PX4_SOURCE_DIR}/Tools/px_process_airframes.py)
set(romfs_pruner ${PX4_SOURCE_DIR}/Tools/px_romfs_pruner.py)
- set(bin_to_obj ${PX4_SOURCE_DIR}/cmake/nuttx/bin_to_obj.py)
+ set(bin_to_obj ${PX4_SOURCE_DIR}/platforms/nuttx/cmake/nuttx/bin_to_obj.py)
set(extras_dir ${CMAKE_CURRENT_BINARY_DIR}/extras)
file(GLOB_RECURSE romfs_src_files ${romfs_src_dir} ${romfs_src_dir}/*)
@@ -626,6 +626,11 @@ function(px4_os_add_flags)
#message(STATUS "nuttx: set(${${var}} ${${${var}}} ${added_${lower_var}} PARENT_SCOPE)")
endforeach()
+ include_directories(
+ ${PX4_SOURCE_DIR}/platforms/nuttx/src/drivers/device
+ ${PX4_SOURCE_DIR}/src/drivers/device
+ )
+
endfunction()
#=============================================================================
diff --git a/cmake/toolchains/Toolchain-arm-none-eabi.cmake b/platforms/nuttx/cmake/toolchains/Toolchain-arm-none-eabi.cmake
similarity index 100%
rename from cmake/toolchains/Toolchain-arm-none-eabi.cmake
rename to platforms/nuttx/cmake/toolchains/Toolchain-arm-none-eabi.cmake
diff --git a/nuttx-configs/PX4_Config.mk b/platforms/nuttx/nuttx-configs/PX4_Config.mk
similarity index 100%
rename from nuttx-configs/PX4_Config.mk
rename to platforms/nuttx/nuttx-configs/PX4_Config.mk
diff --git a/nuttx-configs/PX4_Warnings.mk b/platforms/nuttx/nuttx-configs/PX4_Warnings.mk
similarity index 100%
rename from nuttx-configs/PX4_Warnings.mk
rename to platforms/nuttx/nuttx-configs/PX4_Warnings.mk
diff --git a/nuttx-configs/aerocore/include/board.h b/platforms/nuttx/nuttx-configs/aerocore/include/board.h
similarity index 100%
rename from nuttx-configs/aerocore/include/board.h
rename to platforms/nuttx/nuttx-configs/aerocore/include/board.h
diff --git a/nuttx-configs/aerocore/include/nsh_romfsimg.h b/platforms/nuttx/nuttx-configs/aerocore/include/nsh_romfsimg.h
similarity index 100%
rename from nuttx-configs/aerocore/include/nsh_romfsimg.h
rename to platforms/nuttx/nuttx-configs/aerocore/include/nsh_romfsimg.h
diff --git a/nuttx-configs/aerocore/nsh/Make.defs b/platforms/nuttx/nuttx-configs/aerocore/nsh/Make.defs
similarity index 100%
rename from nuttx-configs/aerocore/nsh/Make.defs
rename to platforms/nuttx/nuttx-configs/aerocore/nsh/Make.defs
diff --git a/nuttx-configs/aerocore/nsh/defconfig b/platforms/nuttx/nuttx-configs/aerocore/nsh/defconfig
similarity index 100%
rename from nuttx-configs/aerocore/nsh/defconfig
rename to platforms/nuttx/nuttx-configs/aerocore/nsh/defconfig
diff --git a/nuttx-configs/aerocore/nsh/setenv.sh b/platforms/nuttx/nuttx-configs/aerocore/nsh/setenv.sh
similarity index 100%
rename from nuttx-configs/aerocore/nsh/setenv.sh
rename to platforms/nuttx/nuttx-configs/aerocore/nsh/setenv.sh
diff --git a/nuttx-configs/aerocore/scripts/ld.script b/platforms/nuttx/nuttx-configs/aerocore/scripts/ld.script
similarity index 100%
rename from nuttx-configs/aerocore/scripts/ld.script
rename to platforms/nuttx/nuttx-configs/aerocore/scripts/ld.script
diff --git a/nuttx-configs/aerocore/src/Makefile b/platforms/nuttx/nuttx-configs/aerocore/src/Makefile
similarity index 100%
rename from nuttx-configs/aerocore/src/Makefile
rename to platforms/nuttx/nuttx-configs/aerocore/src/Makefile
diff --git a/nuttx-configs/aerocore/src/empty.c b/platforms/nuttx/nuttx-configs/aerocore/src/empty.c
similarity index 100%
rename from nuttx-configs/aerocore/src/empty.c
rename to platforms/nuttx/nuttx-configs/aerocore/src/empty.c
diff --git a/nuttx-configs/aerocore2/Kconfig b/platforms/nuttx/nuttx-configs/aerocore2/Kconfig
similarity index 100%
rename from nuttx-configs/aerocore2/Kconfig
rename to platforms/nuttx/nuttx-configs/aerocore2/Kconfig
diff --git a/nuttx-configs/aerocore2/include/board.h b/platforms/nuttx/nuttx-configs/aerocore2/include/board.h
similarity index 100%
rename from nuttx-configs/aerocore2/include/board.h
rename to platforms/nuttx/nuttx-configs/aerocore2/include/board.h
diff --git a/nuttx-configs/aerocore2/include/nsh_romfsimg.h b/platforms/nuttx/nuttx-configs/aerocore2/include/nsh_romfsimg.h
similarity index 100%
rename from nuttx-configs/aerocore2/include/nsh_romfsimg.h
rename to platforms/nuttx/nuttx-configs/aerocore2/include/nsh_romfsimg.h
diff --git a/nuttx-configs/aerocore2/nsh/Make.defs b/platforms/nuttx/nuttx-configs/aerocore2/nsh/Make.defs
similarity index 100%
rename from nuttx-configs/aerocore2/nsh/Make.defs
rename to platforms/nuttx/nuttx-configs/aerocore2/nsh/Make.defs
diff --git a/nuttx-configs/aerocore2/nsh/defconfig b/platforms/nuttx/nuttx-configs/aerocore2/nsh/defconfig
similarity index 100%
rename from nuttx-configs/aerocore2/nsh/defconfig
rename to platforms/nuttx/nuttx-configs/aerocore2/nsh/defconfig
diff --git a/nuttx-configs/aerocore2/nsh/setenv.sh b/platforms/nuttx/nuttx-configs/aerocore2/nsh/setenv.sh
similarity index 100%
rename from nuttx-configs/aerocore2/nsh/setenv.sh
rename to platforms/nuttx/nuttx-configs/aerocore2/nsh/setenv.sh
diff --git a/nuttx-configs/aerocore2/scripts/ld.script b/platforms/nuttx/nuttx-configs/aerocore2/scripts/ld.script
similarity index 100%
rename from nuttx-configs/aerocore2/scripts/ld.script
rename to platforms/nuttx/nuttx-configs/aerocore2/scripts/ld.script
diff --git a/nuttx-configs/aerocore2/src/Makefile b/platforms/nuttx/nuttx-configs/aerocore2/src/Makefile
similarity index 100%
rename from nuttx-configs/aerocore2/src/Makefile
rename to platforms/nuttx/nuttx-configs/aerocore2/src/Makefile
diff --git a/nuttx-configs/aerocore2/src/empty.c b/platforms/nuttx/nuttx-configs/aerocore2/src/empty.c
similarity index 100%
rename from nuttx-configs/aerocore2/src/empty.c
rename to platforms/nuttx/nuttx-configs/aerocore2/src/empty.c
diff --git a/nuttx-configs/aerofc-v1/Kconfig b/platforms/nuttx/nuttx-configs/aerofc-v1/Kconfig
similarity index 100%
rename from nuttx-configs/aerofc-v1/Kconfig
rename to platforms/nuttx/nuttx-configs/aerofc-v1/Kconfig
diff --git a/nuttx-configs/aerofc-v1/include/board.h b/platforms/nuttx/nuttx-configs/aerofc-v1/include/board.h
similarity index 100%
rename from nuttx-configs/aerofc-v1/include/board.h
rename to platforms/nuttx/nuttx-configs/aerofc-v1/include/board.h
diff --git a/nuttx-configs/aerofc-v1/include/nsh_romfsimg.h b/platforms/nuttx/nuttx-configs/aerofc-v1/include/nsh_romfsimg.h
similarity index 100%
rename from nuttx-configs/aerofc-v1/include/nsh_romfsimg.h
rename to platforms/nuttx/nuttx-configs/aerofc-v1/include/nsh_romfsimg.h
diff --git a/nuttx-configs/aerofc-v1/nsh/Make.defs b/platforms/nuttx/nuttx-configs/aerofc-v1/nsh/Make.defs
similarity index 100%
rename from nuttx-configs/aerofc-v1/nsh/Make.defs
rename to platforms/nuttx/nuttx-configs/aerofc-v1/nsh/Make.defs
diff --git a/nuttx-configs/aerofc-v1/nsh/defconfig b/platforms/nuttx/nuttx-configs/aerofc-v1/nsh/defconfig
similarity index 100%
rename from nuttx-configs/aerofc-v1/nsh/defconfig
rename to platforms/nuttx/nuttx-configs/aerofc-v1/nsh/defconfig
diff --git a/nuttx-configs/aerofc-v1/nsh/setenv.sh b/platforms/nuttx/nuttx-configs/aerofc-v1/nsh/setenv.sh
similarity index 100%
rename from nuttx-configs/aerofc-v1/nsh/setenv.sh
rename to platforms/nuttx/nuttx-configs/aerofc-v1/nsh/setenv.sh
diff --git a/nuttx-configs/aerofc-v1/scripts/ld.script b/platforms/nuttx/nuttx-configs/aerofc-v1/scripts/ld.script
similarity index 100%
rename from nuttx-configs/aerofc-v1/scripts/ld.script
rename to platforms/nuttx/nuttx-configs/aerofc-v1/scripts/ld.script
diff --git a/nuttx-configs/aerofc-v1/src/Makefile b/platforms/nuttx/nuttx-configs/aerofc-v1/src/Makefile
similarity index 100%
rename from nuttx-configs/aerofc-v1/src/Makefile
rename to platforms/nuttx/nuttx-configs/aerofc-v1/src/Makefile
diff --git a/nuttx-configs/aerofc-v1/src/empty.c b/platforms/nuttx/nuttx-configs/aerofc-v1/src/empty.c
similarity index 100%
rename from nuttx-configs/aerofc-v1/src/empty.c
rename to platforms/nuttx/nuttx-configs/aerofc-v1/src/empty.c
diff --git a/nuttx-configs/auav-x21/include/board.h b/platforms/nuttx/nuttx-configs/auav-x21/include/board.h
similarity index 100%
rename from nuttx-configs/auav-x21/include/board.h
rename to platforms/nuttx/nuttx-configs/auav-x21/include/board.h
diff --git a/nuttx-configs/auav-x21/include/nsh_romfsimg.h b/platforms/nuttx/nuttx-configs/auav-x21/include/nsh_romfsimg.h
similarity index 100%
rename from nuttx-configs/auav-x21/include/nsh_romfsimg.h
rename to platforms/nuttx/nuttx-configs/auav-x21/include/nsh_romfsimg.h
diff --git a/nuttx-configs/auav-x21/nsh/Make.defs b/platforms/nuttx/nuttx-configs/auav-x21/nsh/Make.defs
similarity index 100%
rename from nuttx-configs/auav-x21/nsh/Make.defs
rename to platforms/nuttx/nuttx-configs/auav-x21/nsh/Make.defs
diff --git a/nuttx-configs/auav-x21/nsh/defconfig b/platforms/nuttx/nuttx-configs/auav-x21/nsh/defconfig
similarity index 100%
rename from nuttx-configs/auav-x21/nsh/defconfig
rename to platforms/nuttx/nuttx-configs/auav-x21/nsh/defconfig
diff --git a/nuttx-configs/auav-x21/nsh/setenv.sh b/platforms/nuttx/nuttx-configs/auav-x21/nsh/setenv.sh
similarity index 100%
rename from nuttx-configs/auav-x21/nsh/setenv.sh
rename to platforms/nuttx/nuttx-configs/auav-x21/nsh/setenv.sh
diff --git a/nuttx-configs/auav-x21/scripts/ld.script b/platforms/nuttx/nuttx-configs/auav-x21/scripts/ld.script
similarity index 100%
rename from nuttx-configs/auav-x21/scripts/ld.script
rename to platforms/nuttx/nuttx-configs/auav-x21/scripts/ld.script
diff --git a/nuttx-configs/auav-x21/src/Makefile b/platforms/nuttx/nuttx-configs/auav-x21/src/Makefile
similarity index 100%
rename from nuttx-configs/auav-x21/src/Makefile
rename to platforms/nuttx/nuttx-configs/auav-x21/src/Makefile
diff --git a/nuttx-configs/auav-x21/src/empty.c b/platforms/nuttx/nuttx-configs/auav-x21/src/empty.c
similarity index 100%
rename from nuttx-configs/auav-x21/src/empty.c
rename to platforms/nuttx/nuttx-configs/auav-x21/src/empty.c
diff --git a/nuttx-configs/crazyflie/include/board.h b/platforms/nuttx/nuttx-configs/crazyflie/include/board.h
similarity index 100%
rename from nuttx-configs/crazyflie/include/board.h
rename to platforms/nuttx/nuttx-configs/crazyflie/include/board.h
diff --git a/nuttx-configs/crazyflie/include/nsh_romfsimg.h b/platforms/nuttx/nuttx-configs/crazyflie/include/nsh_romfsimg.h
similarity index 100%
rename from nuttx-configs/crazyflie/include/nsh_romfsimg.h
rename to platforms/nuttx/nuttx-configs/crazyflie/include/nsh_romfsimg.h
diff --git a/nuttx-configs/crazyflie/nsh/Make.defs b/platforms/nuttx/nuttx-configs/crazyflie/nsh/Make.defs
similarity index 100%
rename from nuttx-configs/crazyflie/nsh/Make.defs
rename to platforms/nuttx/nuttx-configs/crazyflie/nsh/Make.defs
diff --git a/nuttx-configs/crazyflie/nsh/defconfig b/platforms/nuttx/nuttx-configs/crazyflie/nsh/defconfig
similarity index 100%
rename from nuttx-configs/crazyflie/nsh/defconfig
rename to platforms/nuttx/nuttx-configs/crazyflie/nsh/defconfig
diff --git a/nuttx-configs/crazyflie/nsh/setenv.sh b/platforms/nuttx/nuttx-configs/crazyflie/nsh/setenv.sh
similarity index 100%
rename from nuttx-configs/crazyflie/nsh/setenv.sh
rename to platforms/nuttx/nuttx-configs/crazyflie/nsh/setenv.sh
diff --git a/nuttx-configs/crazyflie/scripts/ld.script b/platforms/nuttx/nuttx-configs/crazyflie/scripts/ld.script
similarity index 100%
rename from nuttx-configs/crazyflie/scripts/ld.script
rename to platforms/nuttx/nuttx-configs/crazyflie/scripts/ld.script
diff --git a/nuttx-configs/crazyflie/src/Makefile b/platforms/nuttx/nuttx-configs/crazyflie/src/Makefile
similarity index 100%
rename from nuttx-configs/crazyflie/src/Makefile
rename to platforms/nuttx/nuttx-configs/crazyflie/src/Makefile
diff --git a/nuttx-configs/crazyflie/src/empty.c b/platforms/nuttx/nuttx-configs/crazyflie/src/empty.c
similarity index 100%
rename from nuttx-configs/crazyflie/src/empty.c
rename to platforms/nuttx/nuttx-configs/crazyflie/src/empty.c
diff --git a/nuttx-configs/esc35-v1/Kconfig b/platforms/nuttx/nuttx-configs/esc35-v1/Kconfig
similarity index 100%
rename from nuttx-configs/esc35-v1/Kconfig
rename to platforms/nuttx/nuttx-configs/esc35-v1/Kconfig
diff --git a/nuttx-configs/esc35-v1/bootloader/Make.defs b/platforms/nuttx/nuttx-configs/esc35-v1/bootloader/Make.defs
similarity index 100%
rename from nuttx-configs/esc35-v1/bootloader/Make.defs
rename to platforms/nuttx/nuttx-configs/esc35-v1/bootloader/Make.defs
diff --git a/nuttx-configs/esc35-v1/bootloader/README.txt b/platforms/nuttx/nuttx-configs/esc35-v1/bootloader/README.txt
similarity index 100%
rename from nuttx-configs/esc35-v1/bootloader/README.txt
rename to platforms/nuttx/nuttx-configs/esc35-v1/bootloader/README.txt
diff --git a/nuttx-configs/esc35-v1/bootloader/defconfig b/platforms/nuttx/nuttx-configs/esc35-v1/bootloader/defconfig
similarity index 100%
rename from nuttx-configs/esc35-v1/bootloader/defconfig
rename to platforms/nuttx/nuttx-configs/esc35-v1/bootloader/defconfig
diff --git a/nuttx-configs/esc35-v1/bootloader/setenv.sh b/platforms/nuttx/nuttx-configs/esc35-v1/bootloader/setenv.sh
similarity index 100%
rename from nuttx-configs/esc35-v1/bootloader/setenv.sh
rename to platforms/nuttx/nuttx-configs/esc35-v1/bootloader/setenv.sh
diff --git a/nuttx-configs/esc35-v1/include/README.txt b/platforms/nuttx/nuttx-configs/esc35-v1/include/README.txt
similarity index 100%
rename from nuttx-configs/esc35-v1/include/README.txt
rename to platforms/nuttx/nuttx-configs/esc35-v1/include/README.txt
diff --git a/nuttx-configs/esc35-v1/include/board.h b/platforms/nuttx/nuttx-configs/esc35-v1/include/board.h
similarity index 100%
rename from nuttx-configs/esc35-v1/include/board.h
rename to platforms/nuttx/nuttx-configs/esc35-v1/include/board.h
diff --git a/nuttx-configs/esc35-v1/nsh/Make.defs b/platforms/nuttx/nuttx-configs/esc35-v1/nsh/Make.defs
similarity index 100%
rename from nuttx-configs/esc35-v1/nsh/Make.defs
rename to platforms/nuttx/nuttx-configs/esc35-v1/nsh/Make.defs
diff --git a/nuttx-configs/esc35-v1/nsh/defconfig b/platforms/nuttx/nuttx-configs/esc35-v1/nsh/defconfig
similarity index 100%
rename from nuttx-configs/esc35-v1/nsh/defconfig
rename to platforms/nuttx/nuttx-configs/esc35-v1/nsh/defconfig
diff --git a/nuttx-configs/esc35-v1/nsh/setenv.sh b/platforms/nuttx/nuttx-configs/esc35-v1/nsh/setenv.sh
similarity index 100%
rename from nuttx-configs/esc35-v1/nsh/setenv.sh
rename to platforms/nuttx/nuttx-configs/esc35-v1/nsh/setenv.sh
diff --git a/nuttx-configs/esc35-v1/scripts/bootloaderld.script b/platforms/nuttx/nuttx-configs/esc35-v1/scripts/bootloaderld.script
similarity index 100%
rename from nuttx-configs/esc35-v1/scripts/bootloaderld.script
rename to platforms/nuttx/nuttx-configs/esc35-v1/scripts/bootloaderld.script
diff --git a/nuttx-configs/esc35-v1/scripts/ld.script b/platforms/nuttx/nuttx-configs/esc35-v1/scripts/ld.script
similarity index 100%
rename from nuttx-configs/esc35-v1/scripts/ld.script
rename to platforms/nuttx/nuttx-configs/esc35-v1/scripts/ld.script
diff --git a/nuttx-configs/esc35-v1/src/Makefile b/platforms/nuttx/nuttx-configs/esc35-v1/src/Makefile
similarity index 100%
rename from nuttx-configs/esc35-v1/src/Makefile
rename to platforms/nuttx/nuttx-configs/esc35-v1/src/Makefile
diff --git a/nuttx-configs/esc35-v1/src/empty.c b/platforms/nuttx/nuttx-configs/esc35-v1/src/empty.c
similarity index 100%
rename from nuttx-configs/esc35-v1/src/empty.c
rename to platforms/nuttx/nuttx-configs/esc35-v1/src/empty.c
diff --git a/nuttx-configs/esc35-v1/src/ostubs.c b/platforms/nuttx/nuttx-configs/esc35-v1/src/ostubs.c
similarity index 100%
rename from nuttx-configs/esc35-v1/src/ostubs.c
rename to platforms/nuttx/nuttx-configs/esc35-v1/src/ostubs.c
diff --git a/nuttx-configs/mindpx-v2/include/board.h b/platforms/nuttx/nuttx-configs/mindpx-v2/include/board.h
similarity index 100%
rename from nuttx-configs/mindpx-v2/include/board.h
rename to platforms/nuttx/nuttx-configs/mindpx-v2/include/board.h
diff --git a/nuttx-configs/mindpx-v2/include/nsh_romfsimg.h b/platforms/nuttx/nuttx-configs/mindpx-v2/include/nsh_romfsimg.h
similarity index 100%
rename from nuttx-configs/mindpx-v2/include/nsh_romfsimg.h
rename to platforms/nuttx/nuttx-configs/mindpx-v2/include/nsh_romfsimg.h
diff --git a/nuttx-configs/mindpx-v2/nsh/Make.defs b/platforms/nuttx/nuttx-configs/mindpx-v2/nsh/Make.defs
similarity index 100%
rename from nuttx-configs/mindpx-v2/nsh/Make.defs
rename to platforms/nuttx/nuttx-configs/mindpx-v2/nsh/Make.defs
diff --git a/nuttx-configs/mindpx-v2/nsh/defconfig b/platforms/nuttx/nuttx-configs/mindpx-v2/nsh/defconfig
similarity index 100%
rename from nuttx-configs/mindpx-v2/nsh/defconfig
rename to platforms/nuttx/nuttx-configs/mindpx-v2/nsh/defconfig
diff --git a/nuttx-configs/mindpx-v2/nsh/setenv.sh b/platforms/nuttx/nuttx-configs/mindpx-v2/nsh/setenv.sh
similarity index 100%
rename from nuttx-configs/mindpx-v2/nsh/setenv.sh
rename to platforms/nuttx/nuttx-configs/mindpx-v2/nsh/setenv.sh
diff --git a/nuttx-configs/mindpx-v2/scripts/ld.script b/platforms/nuttx/nuttx-configs/mindpx-v2/scripts/ld.script
similarity index 100%
rename from nuttx-configs/mindpx-v2/scripts/ld.script
rename to platforms/nuttx/nuttx-configs/mindpx-v2/scripts/ld.script
diff --git a/nuttx-configs/mindpx-v2/src/Makefile b/platforms/nuttx/nuttx-configs/mindpx-v2/src/Makefile
similarity index 100%
rename from nuttx-configs/mindpx-v2/src/Makefile
rename to platforms/nuttx/nuttx-configs/mindpx-v2/src/Makefile
diff --git a/nuttx-configs/mindpx-v2/src/empty.c b/platforms/nuttx/nuttx-configs/mindpx-v2/src/empty.c
similarity index 100%
rename from nuttx-configs/mindpx-v2/src/empty.c
rename to platforms/nuttx/nuttx-configs/mindpx-v2/src/empty.c
diff --git a/nuttx-configs/px4cannode-v1/Kconfig b/platforms/nuttx/nuttx-configs/px4-cannode-v1/Kconfig
similarity index 100%
rename from nuttx-configs/px4cannode-v1/Kconfig
rename to platforms/nuttx/nuttx-configs/px4-cannode-v1/Kconfig
diff --git a/nuttx-configs/px4cannode-v1/bootloader/Make.defs b/platforms/nuttx/nuttx-configs/px4-cannode-v1/bootloader/Make.defs
similarity index 100%
rename from nuttx-configs/px4cannode-v1/bootloader/Make.defs
rename to platforms/nuttx/nuttx-configs/px4-cannode-v1/bootloader/Make.defs
diff --git a/nuttx-configs/px4cannode-v1/bootloader/README.txt b/platforms/nuttx/nuttx-configs/px4-cannode-v1/bootloader/README.txt
similarity index 100%
rename from nuttx-configs/px4cannode-v1/bootloader/README.txt
rename to platforms/nuttx/nuttx-configs/px4-cannode-v1/bootloader/README.txt
diff --git a/nuttx-configs/px4cannode-v1/bootloader/defconfig b/platforms/nuttx/nuttx-configs/px4-cannode-v1/bootloader/defconfig
similarity index 100%
rename from nuttx-configs/px4cannode-v1/bootloader/defconfig
rename to platforms/nuttx/nuttx-configs/px4-cannode-v1/bootloader/defconfig
diff --git a/nuttx-configs/px4cannode-v1/bootloader/setenv.sh b/platforms/nuttx/nuttx-configs/px4-cannode-v1/bootloader/setenv.sh
similarity index 100%
rename from nuttx-configs/px4cannode-v1/bootloader/setenv.sh
rename to platforms/nuttx/nuttx-configs/px4-cannode-v1/bootloader/setenv.sh
diff --git a/nuttx-configs/px4cannode-v1/include/README.txt b/platforms/nuttx/nuttx-configs/px4-cannode-v1/include/README.txt
similarity index 100%
rename from nuttx-configs/px4cannode-v1/include/README.txt
rename to platforms/nuttx/nuttx-configs/px4-cannode-v1/include/README.txt
diff --git a/nuttx-configs/px4cannode-v1/include/board.h b/platforms/nuttx/nuttx-configs/px4-cannode-v1/include/board.h
similarity index 100%
rename from nuttx-configs/px4cannode-v1/include/board.h
rename to platforms/nuttx/nuttx-configs/px4-cannode-v1/include/board.h
diff --git a/nuttx-configs/px4cannode-v1/nsh/Make.defs b/platforms/nuttx/nuttx-configs/px4-cannode-v1/nsh/Make.defs
similarity index 100%
rename from nuttx-configs/px4cannode-v1/nsh/Make.defs
rename to platforms/nuttx/nuttx-configs/px4-cannode-v1/nsh/Make.defs
diff --git a/nuttx-configs/px4cannode-v1/nsh/defconfig b/platforms/nuttx/nuttx-configs/px4-cannode-v1/nsh/defconfig
similarity index 100%
rename from nuttx-configs/px4cannode-v1/nsh/defconfig
rename to platforms/nuttx/nuttx-configs/px4-cannode-v1/nsh/defconfig
diff --git a/nuttx-configs/px4cannode-v1/nsh/defconfig.nonsh b/platforms/nuttx/nuttx-configs/px4-cannode-v1/nsh/defconfig.nonsh
similarity index 100%
rename from nuttx-configs/px4cannode-v1/nsh/defconfig.nonsh
rename to platforms/nuttx/nuttx-configs/px4-cannode-v1/nsh/defconfig.nonsh
diff --git a/nuttx-configs/px4cannode-v1/nsh/defconfig.nsh b/platforms/nuttx/nuttx-configs/px4-cannode-v1/nsh/defconfig.nsh
similarity index 100%
rename from nuttx-configs/px4cannode-v1/nsh/defconfig.nsh
rename to platforms/nuttx/nuttx-configs/px4-cannode-v1/nsh/defconfig.nsh
diff --git a/nuttx-configs/px4cannode-v1/nsh/setenv.sh b/platforms/nuttx/nuttx-configs/px4-cannode-v1/nsh/setenv.sh
similarity index 100%
rename from nuttx-configs/px4cannode-v1/nsh/setenv.sh
rename to platforms/nuttx/nuttx-configs/px4-cannode-v1/nsh/setenv.sh
diff --git a/nuttx-configs/px4cannode-v1/scripts/bootloaderld.script b/platforms/nuttx/nuttx-configs/px4-cannode-v1/scripts/bootloaderld.script
similarity index 100%
rename from nuttx-configs/px4cannode-v1/scripts/bootloaderld.script
rename to platforms/nuttx/nuttx-configs/px4-cannode-v1/scripts/bootloaderld.script
diff --git a/nuttx-configs/px4cannode-v1/scripts/ld.script b/platforms/nuttx/nuttx-configs/px4-cannode-v1/scripts/ld.script
similarity index 100%
rename from nuttx-configs/px4cannode-v1/scripts/ld.script
rename to platforms/nuttx/nuttx-configs/px4-cannode-v1/scripts/ld.script
diff --git a/nuttx-configs/px4cannode-v1/src/Makefile b/platforms/nuttx/nuttx-configs/px4-cannode-v1/src/Makefile
similarity index 100%
rename from nuttx-configs/px4cannode-v1/src/Makefile
rename to platforms/nuttx/nuttx-configs/px4-cannode-v1/src/Makefile
diff --git a/nuttx-configs/px4-stm32f4discovery/src/empty.c b/platforms/nuttx/nuttx-configs/px4-cannode-v1/src/empty.c
similarity index 100%
rename from nuttx-configs/px4-stm32f4discovery/src/empty.c
rename to platforms/nuttx/nuttx-configs/px4-cannode-v1/src/empty.c
diff --git a/nuttx-configs/px4cannode-v1/src/ostubs.c b/platforms/nuttx/nuttx-configs/px4-cannode-v1/src/ostubs.c
similarity index 100%
rename from nuttx-configs/px4cannode-v1/src/ostubs.c
rename to platforms/nuttx/nuttx-configs/px4-cannode-v1/src/ostubs.c
diff --git a/nuttx-configs/px4esc-v1/Kconfig b/platforms/nuttx/nuttx-configs/px4-esc-v1/Kconfig
similarity index 100%
rename from nuttx-configs/px4esc-v1/Kconfig
rename to platforms/nuttx/nuttx-configs/px4-esc-v1/Kconfig
diff --git a/nuttx-configs/px4esc-v1/bootloader/Make.defs b/platforms/nuttx/nuttx-configs/px4-esc-v1/bootloader/Make.defs
similarity index 100%
rename from nuttx-configs/px4esc-v1/bootloader/Make.defs
rename to platforms/nuttx/nuttx-configs/px4-esc-v1/bootloader/Make.defs
diff --git a/nuttx-configs/px4esc-v1/bootloader/README.txt b/platforms/nuttx/nuttx-configs/px4-esc-v1/bootloader/README.txt
similarity index 100%
rename from nuttx-configs/px4esc-v1/bootloader/README.txt
rename to platforms/nuttx/nuttx-configs/px4-esc-v1/bootloader/README.txt
diff --git a/nuttx-configs/px4esc-v1/bootloader/defconfig b/platforms/nuttx/nuttx-configs/px4-esc-v1/bootloader/defconfig
similarity index 100%
rename from nuttx-configs/px4esc-v1/bootloader/defconfig
rename to platforms/nuttx/nuttx-configs/px4-esc-v1/bootloader/defconfig
diff --git a/nuttx-configs/px4esc-v1/bootloader/setenv.sh b/platforms/nuttx/nuttx-configs/px4-esc-v1/bootloader/setenv.sh
similarity index 100%
rename from nuttx-configs/px4esc-v1/bootloader/setenv.sh
rename to platforms/nuttx/nuttx-configs/px4-esc-v1/bootloader/setenv.sh
diff --git a/nuttx-configs/px4esc-v1/include/README.txt b/platforms/nuttx/nuttx-configs/px4-esc-v1/include/README.txt
similarity index 100%
rename from nuttx-configs/px4esc-v1/include/README.txt
rename to platforms/nuttx/nuttx-configs/px4-esc-v1/include/README.txt
diff --git a/nuttx-configs/px4esc-v1/include/board.h b/platforms/nuttx/nuttx-configs/px4-esc-v1/include/board.h
similarity index 100%
rename from nuttx-configs/px4esc-v1/include/board.h
rename to platforms/nuttx/nuttx-configs/px4-esc-v1/include/board.h
diff --git a/nuttx-configs/px4esc-v1/nsh/Make.defs b/platforms/nuttx/nuttx-configs/px4-esc-v1/nsh/Make.defs
similarity index 100%
rename from nuttx-configs/px4esc-v1/nsh/Make.defs
rename to platforms/nuttx/nuttx-configs/px4-esc-v1/nsh/Make.defs
diff --git a/nuttx-configs/px4esc-v1/nsh/defconfig b/platforms/nuttx/nuttx-configs/px4-esc-v1/nsh/defconfig
similarity index 100%
rename from nuttx-configs/px4esc-v1/nsh/defconfig
rename to platforms/nuttx/nuttx-configs/px4-esc-v1/nsh/defconfig
diff --git a/nuttx-configs/px4esc-v1/nsh/setenv.sh b/platforms/nuttx/nuttx-configs/px4-esc-v1/nsh/setenv.sh
similarity index 100%
rename from nuttx-configs/px4esc-v1/nsh/setenv.sh
rename to platforms/nuttx/nuttx-configs/px4-esc-v1/nsh/setenv.sh
diff --git a/nuttx-configs/px4esc-v1/scripts/bootloaderld.script b/platforms/nuttx/nuttx-configs/px4-esc-v1/scripts/bootloaderld.script
similarity index 100%
rename from nuttx-configs/px4esc-v1/scripts/bootloaderld.script
rename to platforms/nuttx/nuttx-configs/px4-esc-v1/scripts/bootloaderld.script
diff --git a/nuttx-configs/px4esc-v1/scripts/ld.script b/platforms/nuttx/nuttx-configs/px4-esc-v1/scripts/ld.script
similarity index 100%
rename from nuttx-configs/px4esc-v1/scripts/ld.script
rename to platforms/nuttx/nuttx-configs/px4-esc-v1/scripts/ld.script
diff --git a/nuttx-configs/px4esc-v1/src/Makefile b/platforms/nuttx/nuttx-configs/px4-esc-v1/src/Makefile
similarity index 100%
rename from nuttx-configs/px4esc-v1/src/Makefile
rename to platforms/nuttx/nuttx-configs/px4-esc-v1/src/Makefile
diff --git a/nuttx-configs/px4cannode-v1/src/empty.c b/platforms/nuttx/nuttx-configs/px4-esc-v1/src/empty.c
similarity index 100%
rename from nuttx-configs/px4cannode-v1/src/empty.c
rename to platforms/nuttx/nuttx-configs/px4-esc-v1/src/empty.c
diff --git a/nuttx-configs/px4esc-v1/src/ostubs.c b/platforms/nuttx/nuttx-configs/px4-esc-v1/src/ostubs.c
similarity index 100%
rename from nuttx-configs/px4esc-v1/src/ostubs.c
rename to platforms/nuttx/nuttx-configs/px4-esc-v1/src/ostubs.c
diff --git a/nuttx-configs/px4flow-v2/Kconfig b/platforms/nuttx/nuttx-configs/px4-flow-v2/Kconfig
similarity index 100%
rename from nuttx-configs/px4flow-v2/Kconfig
rename to platforms/nuttx/nuttx-configs/px4-flow-v2/Kconfig
diff --git a/nuttx-configs/px4flow-v2/bootloader/Make.defs b/platforms/nuttx/nuttx-configs/px4-flow-v2/bootloader/Make.defs
similarity index 100%
rename from nuttx-configs/px4flow-v2/bootloader/Make.defs
rename to platforms/nuttx/nuttx-configs/px4-flow-v2/bootloader/Make.defs
diff --git a/nuttx-configs/px4flow-v2/bootloader/README.txt b/platforms/nuttx/nuttx-configs/px4-flow-v2/bootloader/README.txt
similarity index 100%
rename from nuttx-configs/px4flow-v2/bootloader/README.txt
rename to platforms/nuttx/nuttx-configs/px4-flow-v2/bootloader/README.txt
diff --git a/nuttx-configs/px4flow-v2/bootloader/defconfig b/platforms/nuttx/nuttx-configs/px4-flow-v2/bootloader/defconfig
similarity index 100%
rename from nuttx-configs/px4flow-v2/bootloader/defconfig
rename to platforms/nuttx/nuttx-configs/px4-flow-v2/bootloader/defconfig
diff --git a/nuttx-configs/px4flow-v2/bootloader/setenv.sh b/platforms/nuttx/nuttx-configs/px4-flow-v2/bootloader/setenv.sh
similarity index 100%
rename from nuttx-configs/px4flow-v2/bootloader/setenv.sh
rename to platforms/nuttx/nuttx-configs/px4-flow-v2/bootloader/setenv.sh
diff --git a/nuttx-configs/px4flow-v2/include/README.txt b/platforms/nuttx/nuttx-configs/px4-flow-v2/include/README.txt
similarity index 100%
rename from nuttx-configs/px4flow-v2/include/README.txt
rename to platforms/nuttx/nuttx-configs/px4-flow-v2/include/README.txt
diff --git a/nuttx-configs/px4flow-v2/include/board.h b/platforms/nuttx/nuttx-configs/px4-flow-v2/include/board.h
similarity index 100%
rename from nuttx-configs/px4flow-v2/include/board.h
rename to platforms/nuttx/nuttx-configs/px4-flow-v2/include/board.h
diff --git a/nuttx-configs/px4flow-v2/nsh/Make.defs b/platforms/nuttx/nuttx-configs/px4-flow-v2/nsh/Make.defs
similarity index 100%
rename from nuttx-configs/px4flow-v2/nsh/Make.defs
rename to platforms/nuttx/nuttx-configs/px4-flow-v2/nsh/Make.defs
diff --git a/nuttx-configs/px4flow-v2/nsh/defconfig b/platforms/nuttx/nuttx-configs/px4-flow-v2/nsh/defconfig
similarity index 100%
rename from nuttx-configs/px4flow-v2/nsh/defconfig
rename to platforms/nuttx/nuttx-configs/px4-flow-v2/nsh/defconfig
diff --git a/nuttx-configs/px4flow-v2/nsh/setenv.sh b/platforms/nuttx/nuttx-configs/px4-flow-v2/nsh/setenv.sh
similarity index 100%
rename from nuttx-configs/px4flow-v2/nsh/setenv.sh
rename to platforms/nuttx/nuttx-configs/px4-flow-v2/nsh/setenv.sh
diff --git a/nuttx-configs/px4flow-v2/scripts/bootloaderld.script b/platforms/nuttx/nuttx-configs/px4-flow-v2/scripts/bootloaderld.script
similarity index 100%
rename from nuttx-configs/px4flow-v2/scripts/bootloaderld.script
rename to platforms/nuttx/nuttx-configs/px4-flow-v2/scripts/bootloaderld.script
diff --git a/nuttx-configs/px4flow-v2/scripts/ld.script b/platforms/nuttx/nuttx-configs/px4-flow-v2/scripts/ld.script
similarity index 100%
rename from nuttx-configs/px4flow-v2/scripts/ld.script
rename to platforms/nuttx/nuttx-configs/px4-flow-v2/scripts/ld.script
diff --git a/nuttx-configs/px4flow-v2/src/Makefile b/platforms/nuttx/nuttx-configs/px4-flow-v2/src/Makefile
similarity index 100%
rename from nuttx-configs/px4flow-v2/src/Makefile
rename to platforms/nuttx/nuttx-configs/px4-flow-v2/src/Makefile
diff --git a/nuttx-configs/px4esc-v1/src/empty.c b/platforms/nuttx/nuttx-configs/px4-flow-v2/src/empty.c
similarity index 100%
rename from nuttx-configs/px4esc-v1/src/empty.c
rename to platforms/nuttx/nuttx-configs/px4-flow-v2/src/empty.c
diff --git a/nuttx-configs/px4flow-v2/src/ostubs.c b/platforms/nuttx/nuttx-configs/px4-flow-v2/src/ostubs.c
similarity index 100%
rename from nuttx-configs/px4flow-v2/src/ostubs.c
rename to platforms/nuttx/nuttx-configs/px4-flow-v2/src/ostubs.c
diff --git a/nuttx-configs/px4fmu-v1/include/board.h b/platforms/nuttx/nuttx-configs/px4-fmu-v1/include/board.h
similarity index 100%
rename from nuttx-configs/px4fmu-v1/include/board.h
rename to platforms/nuttx/nuttx-configs/px4-fmu-v1/include/board.h
diff --git a/nuttx-configs/px4-stm32f4discovery/include/nsh_romfsimg.h b/platforms/nuttx/nuttx-configs/px4-fmu-v1/include/nsh_romfsimg.h
similarity index 100%
rename from nuttx-configs/px4-stm32f4discovery/include/nsh_romfsimg.h
rename to platforms/nuttx/nuttx-configs/px4-fmu-v1/include/nsh_romfsimg.h
diff --git a/nuttx-configs/px4fmu-v1/nsh/Make.defs b/platforms/nuttx/nuttx-configs/px4-fmu-v1/nsh/Make.defs
similarity index 100%
rename from nuttx-configs/px4fmu-v1/nsh/Make.defs
rename to platforms/nuttx/nuttx-configs/px4-fmu-v1/nsh/Make.defs
diff --git a/nuttx-configs/px4fmu-v1/nsh/defconfig b/platforms/nuttx/nuttx-configs/px4-fmu-v1/nsh/defconfig
similarity index 100%
rename from nuttx-configs/px4fmu-v1/nsh/defconfig
rename to platforms/nuttx/nuttx-configs/px4-fmu-v1/nsh/defconfig
diff --git a/nuttx-configs/px4fmu-v1/nsh/setenv.sh b/platforms/nuttx/nuttx-configs/px4-fmu-v1/nsh/setenv.sh
similarity index 100%
rename from nuttx-configs/px4fmu-v1/nsh/setenv.sh
rename to platforms/nuttx/nuttx-configs/px4-fmu-v1/nsh/setenv.sh
diff --git a/nuttx-configs/px4fmu-v1/scripts/ld.script b/platforms/nuttx/nuttx-configs/px4-fmu-v1/scripts/ld.script
similarity index 100%
rename from nuttx-configs/px4fmu-v1/scripts/ld.script
rename to platforms/nuttx/nuttx-configs/px4-fmu-v1/scripts/ld.script
diff --git a/nuttx-configs/px4fmu-v1/src/Makefile b/platforms/nuttx/nuttx-configs/px4-fmu-v1/src/Makefile
similarity index 100%
rename from nuttx-configs/px4fmu-v1/src/Makefile
rename to platforms/nuttx/nuttx-configs/px4-fmu-v1/src/Makefile
diff --git a/nuttx-configs/px4flow-v2/src/empty.c b/platforms/nuttx/nuttx-configs/px4-fmu-v1/src/empty.c
similarity index 100%
rename from nuttx-configs/px4flow-v2/src/empty.c
rename to platforms/nuttx/nuttx-configs/px4-fmu-v1/src/empty.c
diff --git a/nuttx-configs/px4fmu-v2/Kconfig b/platforms/nuttx/nuttx-configs/px4-fmu-v2/Kconfig
similarity index 100%
rename from nuttx-configs/px4fmu-v2/Kconfig
rename to platforms/nuttx/nuttx-configs/px4-fmu-v2/Kconfig
diff --git a/nuttx-configs/px4fmu-v2/include/board.h b/platforms/nuttx/nuttx-configs/px4-fmu-v2/include/board.h
similarity index 100%
rename from nuttx-configs/px4fmu-v2/include/board.h
rename to platforms/nuttx/nuttx-configs/px4-fmu-v2/include/board.h
diff --git a/nuttx-configs/px4fmu-v1/include/nsh_romfsimg.h b/platforms/nuttx/nuttx-configs/px4-fmu-v2/include/nsh_romfsimg.h
similarity index 100%
rename from nuttx-configs/px4fmu-v1/include/nsh_romfsimg.h
rename to platforms/nuttx/nuttx-configs/px4-fmu-v2/include/nsh_romfsimg.h
diff --git a/nuttx-configs/px4fmu-v2/nsh/Make.defs b/platforms/nuttx/nuttx-configs/px4-fmu-v2/nsh/Make.defs
similarity index 100%
rename from nuttx-configs/px4fmu-v2/nsh/Make.defs
rename to platforms/nuttx/nuttx-configs/px4-fmu-v2/nsh/Make.defs
diff --git a/nuttx-configs/px4fmu-v2/nsh/defconfig b/platforms/nuttx/nuttx-configs/px4-fmu-v2/nsh/defconfig
similarity index 100%
rename from nuttx-configs/px4fmu-v2/nsh/defconfig
rename to platforms/nuttx/nuttx-configs/px4-fmu-v2/nsh/defconfig
diff --git a/nuttx-configs/px4fmu-v2/nsh/setenv.sh b/platforms/nuttx/nuttx-configs/px4-fmu-v2/nsh/setenv.sh
similarity index 100%
rename from nuttx-configs/px4fmu-v2/nsh/setenv.sh
rename to platforms/nuttx/nuttx-configs/px4-fmu-v2/nsh/setenv.sh
diff --git a/nuttx-configs/px4fmu-v2/scripts/ld.script b/platforms/nuttx/nuttx-configs/px4-fmu-v2/scripts/ld.script
similarity index 100%
rename from nuttx-configs/px4fmu-v2/scripts/ld.script
rename to platforms/nuttx/nuttx-configs/px4-fmu-v2/scripts/ld.script
diff --git a/nuttx-configs/px4fmu-v2/src/Makefile b/platforms/nuttx/nuttx-configs/px4-fmu-v2/src/Makefile
similarity index 100%
rename from nuttx-configs/px4fmu-v2/src/Makefile
rename to platforms/nuttx/nuttx-configs/px4-fmu-v2/src/Makefile
diff --git a/nuttx-configs/px4fmu-v1/src/empty.c b/platforms/nuttx/nuttx-configs/px4-fmu-v2/src/empty.c
similarity index 100%
rename from nuttx-configs/px4fmu-v1/src/empty.c
rename to platforms/nuttx/nuttx-configs/px4-fmu-v2/src/empty.c
diff --git a/nuttx-configs/px4fmu-v3/Kconfig b/platforms/nuttx/nuttx-configs/px4-fmu-v3/Kconfig
similarity index 100%
rename from nuttx-configs/px4fmu-v3/Kconfig
rename to platforms/nuttx/nuttx-configs/px4-fmu-v3/Kconfig
diff --git a/nuttx-configs/px4fmu-v3/include/board.h b/platforms/nuttx/nuttx-configs/px4-fmu-v3/include/board.h
similarity index 100%
rename from nuttx-configs/px4fmu-v3/include/board.h
rename to platforms/nuttx/nuttx-configs/px4-fmu-v3/include/board.h
diff --git a/nuttx-configs/px4fmu-v2/include/nsh_romfsimg.h b/platforms/nuttx/nuttx-configs/px4-fmu-v3/include/nsh_romfsimg.h
similarity index 100%
rename from nuttx-configs/px4fmu-v2/include/nsh_romfsimg.h
rename to platforms/nuttx/nuttx-configs/px4-fmu-v3/include/nsh_romfsimg.h
diff --git a/nuttx-configs/px4fmu-v3/nsh/Make.defs b/platforms/nuttx/nuttx-configs/px4-fmu-v3/nsh/Make.defs
similarity index 100%
rename from nuttx-configs/px4fmu-v3/nsh/Make.defs
rename to platforms/nuttx/nuttx-configs/px4-fmu-v3/nsh/Make.defs
diff --git a/nuttx-configs/px4fmu-v3/nsh/defconfig b/platforms/nuttx/nuttx-configs/px4-fmu-v3/nsh/defconfig
similarity index 100%
rename from nuttx-configs/px4fmu-v3/nsh/defconfig
rename to platforms/nuttx/nuttx-configs/px4-fmu-v3/nsh/defconfig
diff --git a/nuttx-configs/px4fmu-v3/nsh/setenv.sh b/platforms/nuttx/nuttx-configs/px4-fmu-v3/nsh/setenv.sh
similarity index 100%
rename from nuttx-configs/px4fmu-v3/nsh/setenv.sh
rename to platforms/nuttx/nuttx-configs/px4-fmu-v3/nsh/setenv.sh
diff --git a/nuttx-configs/px4fmu-v3/scripts/ld.script b/platforms/nuttx/nuttx-configs/px4-fmu-v3/scripts/ld.script
similarity index 100%
rename from nuttx-configs/px4fmu-v3/scripts/ld.script
rename to platforms/nuttx/nuttx-configs/px4-fmu-v3/scripts/ld.script
diff --git a/nuttx-configs/px4fmu-v3/src/Makefile b/platforms/nuttx/nuttx-configs/px4-fmu-v3/src/Makefile
similarity index 100%
rename from nuttx-configs/px4fmu-v3/src/Makefile
rename to platforms/nuttx/nuttx-configs/px4-fmu-v3/src/Makefile
diff --git a/nuttx-configs/px4fmu-v2/src/empty.c b/platforms/nuttx/nuttx-configs/px4-fmu-v3/src/empty.c
similarity index 100%
rename from nuttx-configs/px4fmu-v2/src/empty.c
rename to platforms/nuttx/nuttx-configs/px4-fmu-v3/src/empty.c
diff --git a/nuttx-configs/px4fmu-v4/include/board.h b/platforms/nuttx/nuttx-configs/px4-fmu-v4/include/board.h
similarity index 100%
rename from nuttx-configs/px4fmu-v4/include/board.h
rename to platforms/nuttx/nuttx-configs/px4-fmu-v4/include/board.h
diff --git a/nuttx-configs/px4fmu-v3/include/nsh_romfsimg.h b/platforms/nuttx/nuttx-configs/px4-fmu-v4/include/nsh_romfsimg.h
similarity index 100%
rename from nuttx-configs/px4fmu-v3/include/nsh_romfsimg.h
rename to platforms/nuttx/nuttx-configs/px4-fmu-v4/include/nsh_romfsimg.h
diff --git a/nuttx-configs/px4fmu-v4/nsh/Make.defs b/platforms/nuttx/nuttx-configs/px4-fmu-v4/nsh/Make.defs
similarity index 100%
rename from nuttx-configs/px4fmu-v4/nsh/Make.defs
rename to platforms/nuttx/nuttx-configs/px4-fmu-v4/nsh/Make.defs
diff --git a/nuttx-configs/px4fmu-v4/nsh/defconfig b/platforms/nuttx/nuttx-configs/px4-fmu-v4/nsh/defconfig
similarity index 100%
rename from nuttx-configs/px4fmu-v4/nsh/defconfig
rename to platforms/nuttx/nuttx-configs/px4-fmu-v4/nsh/defconfig
diff --git a/nuttx-configs/px4fmu-v4/nsh/setenv.sh b/platforms/nuttx/nuttx-configs/px4-fmu-v4/nsh/setenv.sh
similarity index 100%
rename from nuttx-configs/px4fmu-v4/nsh/setenv.sh
rename to platforms/nuttx/nuttx-configs/px4-fmu-v4/nsh/setenv.sh
diff --git a/nuttx-configs/px4fmu-v4/scripts/ld.script b/platforms/nuttx/nuttx-configs/px4-fmu-v4/scripts/ld.script
similarity index 100%
rename from nuttx-configs/px4fmu-v4/scripts/ld.script
rename to platforms/nuttx/nuttx-configs/px4-fmu-v4/scripts/ld.script
diff --git a/nuttx-configs/px4fmu-v4/src/Makefile b/platforms/nuttx/nuttx-configs/px4-fmu-v4/src/Makefile
similarity index 100%
rename from nuttx-configs/px4fmu-v4/src/Makefile
rename to platforms/nuttx/nuttx-configs/px4-fmu-v4/src/Makefile
diff --git a/nuttx-configs/px4fmu-v3/src/empty.c b/platforms/nuttx/nuttx-configs/px4-fmu-v4/src/empty.c
similarity index 100%
rename from nuttx-configs/px4fmu-v3/src/empty.c
rename to platforms/nuttx/nuttx-configs/px4-fmu-v4/src/empty.c
diff --git a/nuttx-configs/px4fmu-v4pro/Kconfig b/platforms/nuttx/nuttx-configs/px4-fmu-v4pro/Kconfig
similarity index 100%
rename from nuttx-configs/px4fmu-v4pro/Kconfig
rename to platforms/nuttx/nuttx-configs/px4-fmu-v4pro/Kconfig
diff --git a/nuttx-configs/px4fmu-v4pro/include/board.h b/platforms/nuttx/nuttx-configs/px4-fmu-v4pro/include/board.h
similarity index 100%
rename from nuttx-configs/px4fmu-v4pro/include/board.h
rename to platforms/nuttx/nuttx-configs/px4-fmu-v4pro/include/board.h
diff --git a/nuttx-configs/px4fmu-v4/include/nsh_romfsimg.h b/platforms/nuttx/nuttx-configs/px4-fmu-v4pro/include/nsh_romfsimg.h
similarity index 100%
rename from nuttx-configs/px4fmu-v4/include/nsh_romfsimg.h
rename to platforms/nuttx/nuttx-configs/px4-fmu-v4pro/include/nsh_romfsimg.h
diff --git a/nuttx-configs/px4fmu-v4pro/nsh/Make.defs b/platforms/nuttx/nuttx-configs/px4-fmu-v4pro/nsh/Make.defs
similarity index 100%
rename from nuttx-configs/px4fmu-v4pro/nsh/Make.defs
rename to platforms/nuttx/nuttx-configs/px4-fmu-v4pro/nsh/Make.defs
diff --git a/nuttx-configs/px4fmu-v4pro/nsh/defconfig b/platforms/nuttx/nuttx-configs/px4-fmu-v4pro/nsh/defconfig
similarity index 100%
rename from nuttx-configs/px4fmu-v4pro/nsh/defconfig
rename to platforms/nuttx/nuttx-configs/px4-fmu-v4pro/nsh/defconfig
diff --git a/nuttx-configs/px4fmu-v4pro/nsh/setenv.sh b/platforms/nuttx/nuttx-configs/px4-fmu-v4pro/nsh/setenv.sh
similarity index 100%
rename from nuttx-configs/px4fmu-v4pro/nsh/setenv.sh
rename to platforms/nuttx/nuttx-configs/px4-fmu-v4pro/nsh/setenv.sh
diff --git a/nuttx-configs/px4fmu-v4pro/scripts/ld.script b/platforms/nuttx/nuttx-configs/px4-fmu-v4pro/scripts/ld.script
similarity index 100%
rename from nuttx-configs/px4fmu-v4pro/scripts/ld.script
rename to platforms/nuttx/nuttx-configs/px4-fmu-v4pro/scripts/ld.script
diff --git a/nuttx-configs/px4fmu-v4pro/src/Makefile b/platforms/nuttx/nuttx-configs/px4-fmu-v4pro/src/Makefile
similarity index 100%
rename from nuttx-configs/px4fmu-v4pro/src/Makefile
rename to platforms/nuttx/nuttx-configs/px4-fmu-v4pro/src/Makefile
diff --git a/nuttx-configs/px4fmu-v4/src/empty.c b/platforms/nuttx/nuttx-configs/px4-fmu-v4pro/src/empty.c
similarity index 100%
rename from nuttx-configs/px4fmu-v4/src/empty.c
rename to platforms/nuttx/nuttx-configs/px4-fmu-v4pro/src/empty.c
diff --git a/nuttx-configs/px4fmu-v5/Kconfig b/platforms/nuttx/nuttx-configs/px4-fmu-v5/Kconfig
similarity index 100%
rename from nuttx-configs/px4fmu-v5/Kconfig
rename to platforms/nuttx/nuttx-configs/px4-fmu-v5/Kconfig
diff --git a/nuttx-configs/px4fmu-v5/include/board.h b/platforms/nuttx/nuttx-configs/px4-fmu-v5/include/board.h
similarity index 100%
rename from nuttx-configs/px4fmu-v5/include/board.h
rename to platforms/nuttx/nuttx-configs/px4-fmu-v5/include/board.h
diff --git a/nuttx-configs/px4fmu-v5/include/nsh_romfsimg.h b/platforms/nuttx/nuttx-configs/px4-fmu-v5/include/nsh_romfsimg.h
similarity index 100%
rename from nuttx-configs/px4fmu-v5/include/nsh_romfsimg.h
rename to platforms/nuttx/nuttx-configs/px4-fmu-v5/include/nsh_romfsimg.h
diff --git a/nuttx-configs/px4fmu-v5/nsh/Make.defs b/platforms/nuttx/nuttx-configs/px4-fmu-v5/nsh/Make.defs
similarity index 100%
rename from nuttx-configs/px4fmu-v5/nsh/Make.defs
rename to platforms/nuttx/nuttx-configs/px4-fmu-v5/nsh/Make.defs
diff --git a/nuttx-configs/px4fmu-v5/nsh/defconfig b/platforms/nuttx/nuttx-configs/px4-fmu-v5/nsh/defconfig
similarity index 100%
rename from nuttx-configs/px4fmu-v5/nsh/defconfig
rename to platforms/nuttx/nuttx-configs/px4-fmu-v5/nsh/defconfig
diff --git a/nuttx-configs/px4fmu-v5/nsh/setenv.sh b/platforms/nuttx/nuttx-configs/px4-fmu-v5/nsh/setenv.sh
similarity index 100%
rename from nuttx-configs/px4fmu-v5/nsh/setenv.sh
rename to platforms/nuttx/nuttx-configs/px4-fmu-v5/nsh/setenv.sh
diff --git a/nuttx-configs/px4fmu-v5/scripts/ld.script b/platforms/nuttx/nuttx-configs/px4-fmu-v5/scripts/ld.script
similarity index 100%
rename from nuttx-configs/px4fmu-v5/scripts/ld.script
rename to platforms/nuttx/nuttx-configs/px4-fmu-v5/scripts/ld.script
diff --git a/nuttx-configs/px4fmu-v5/src/Makefile b/platforms/nuttx/nuttx-configs/px4-fmu-v5/src/Makefile
similarity index 100%
rename from nuttx-configs/px4fmu-v5/src/Makefile
rename to platforms/nuttx/nuttx-configs/px4-fmu-v5/src/Makefile
diff --git a/nuttx-configs/px4fmu-v4pro/src/empty.c b/platforms/nuttx/nuttx-configs/px4-fmu-v5/src/empty.c
similarity index 100%
rename from nuttx-configs/px4fmu-v4pro/src/empty.c
rename to platforms/nuttx/nuttx-configs/px4-fmu-v5/src/empty.c
diff --git a/nuttx-configs/px4nucleoF767ZI-v1/Kconfig b/platforms/nuttx/nuttx-configs/px4-nucleoF767ZI-v1/Kconfig
similarity index 100%
rename from nuttx-configs/px4nucleoF767ZI-v1/Kconfig
rename to platforms/nuttx/nuttx-configs/px4-nucleoF767ZI-v1/Kconfig
diff --git a/nuttx-configs/px4nucleoF767ZI-v1/include/board.h b/platforms/nuttx/nuttx-configs/px4-nucleoF767ZI-v1/include/board.h
similarity index 100%
rename from nuttx-configs/px4nucleoF767ZI-v1/include/board.h
rename to platforms/nuttx/nuttx-configs/px4-nucleoF767ZI-v1/include/board.h
diff --git a/nuttx-configs/px4nucleoF767ZI-v1/include/nsh_romfsimg.h b/platforms/nuttx/nuttx-configs/px4-nucleoF767ZI-v1/include/nsh_romfsimg.h
similarity index 100%
rename from nuttx-configs/px4nucleoF767ZI-v1/include/nsh_romfsimg.h
rename to platforms/nuttx/nuttx-configs/px4-nucleoF767ZI-v1/include/nsh_romfsimg.h
diff --git a/nuttx-configs/px4nucleoF767ZI-v1/nsh/Make.defs b/platforms/nuttx/nuttx-configs/px4-nucleoF767ZI-v1/nsh/Make.defs
similarity index 100%
rename from nuttx-configs/px4nucleoF767ZI-v1/nsh/Make.defs
rename to platforms/nuttx/nuttx-configs/px4-nucleoF767ZI-v1/nsh/Make.defs
diff --git a/nuttx-configs/px4nucleoF767ZI-v1/nsh/defconfig b/platforms/nuttx/nuttx-configs/px4-nucleoF767ZI-v1/nsh/defconfig
similarity index 100%
rename from nuttx-configs/px4nucleoF767ZI-v1/nsh/defconfig
rename to platforms/nuttx/nuttx-configs/px4-nucleoF767ZI-v1/nsh/defconfig
diff --git a/nuttx-configs/px4nucleoF767ZI-v1/nsh/setenv.sh b/platforms/nuttx/nuttx-configs/px4-nucleoF767ZI-v1/nsh/setenv.sh
similarity index 100%
rename from nuttx-configs/px4nucleoF767ZI-v1/nsh/setenv.sh
rename to platforms/nuttx/nuttx-configs/px4-nucleoF767ZI-v1/nsh/setenv.sh
diff --git a/nuttx-configs/px4nucleoF767ZI-v1/scripts/ld.script b/platforms/nuttx/nuttx-configs/px4-nucleoF767ZI-v1/scripts/ld.script
similarity index 100%
rename from nuttx-configs/px4nucleoF767ZI-v1/scripts/ld.script
rename to platforms/nuttx/nuttx-configs/px4-nucleoF767ZI-v1/scripts/ld.script
diff --git a/nuttx-configs/px4nucleoF767ZI-v1/src/Makefile b/platforms/nuttx/nuttx-configs/px4-nucleoF767ZI-v1/src/Makefile
similarity index 100%
rename from nuttx-configs/px4nucleoF767ZI-v1/src/Makefile
rename to platforms/nuttx/nuttx-configs/px4-nucleoF767ZI-v1/src/Makefile
diff --git a/nuttx-configs/px4fmu-v5/src/empty.c b/platforms/nuttx/nuttx-configs/px4-nucleoF767ZI-v1/src/empty.c
similarity index 100%
rename from nuttx-configs/px4fmu-v5/src/empty.c
rename to platforms/nuttx/nuttx-configs/px4-nucleoF767ZI-v1/src/empty.c
diff --git a/nuttx-configs/px4-stm32f4discovery/include/board.h b/platforms/nuttx/nuttx-configs/px4-stm32f4discovery/include/board.h
similarity index 100%
rename from nuttx-configs/px4-stm32f4discovery/include/board.h
rename to platforms/nuttx/nuttx-configs/px4-stm32f4discovery/include/board.h
diff --git a/nuttx-configs/px4fmu-v4pro/include/nsh_romfsimg.h b/platforms/nuttx/nuttx-configs/px4-stm32f4discovery/include/nsh_romfsimg.h
similarity index 100%
rename from nuttx-configs/px4fmu-v4pro/include/nsh_romfsimg.h
rename to platforms/nuttx/nuttx-configs/px4-stm32f4discovery/include/nsh_romfsimg.h
diff --git a/nuttx-configs/px4-stm32f4discovery/nsh/Make.defs b/platforms/nuttx/nuttx-configs/px4-stm32f4discovery/nsh/Make.defs
similarity index 100%
rename from nuttx-configs/px4-stm32f4discovery/nsh/Make.defs
rename to platforms/nuttx/nuttx-configs/px4-stm32f4discovery/nsh/Make.defs
diff --git a/nuttx-configs/px4-stm32f4discovery/nsh/defconfig b/platforms/nuttx/nuttx-configs/px4-stm32f4discovery/nsh/defconfig
similarity index 100%
rename from nuttx-configs/px4-stm32f4discovery/nsh/defconfig
rename to platforms/nuttx/nuttx-configs/px4-stm32f4discovery/nsh/defconfig
diff --git a/nuttx-configs/px4-stm32f4discovery/nsh/setenv.sh b/platforms/nuttx/nuttx-configs/px4-stm32f4discovery/nsh/setenv.sh
similarity index 100%
rename from nuttx-configs/px4-stm32f4discovery/nsh/setenv.sh
rename to platforms/nuttx/nuttx-configs/px4-stm32f4discovery/nsh/setenv.sh
diff --git a/nuttx-configs/px4-stm32f4discovery/scripts/ld.script b/platforms/nuttx/nuttx-configs/px4-stm32f4discovery/scripts/ld.script
similarity index 100%
rename from nuttx-configs/px4-stm32f4discovery/scripts/ld.script
rename to platforms/nuttx/nuttx-configs/px4-stm32f4discovery/scripts/ld.script
diff --git a/nuttx-configs/px4-stm32f4discovery/src/Makefile b/platforms/nuttx/nuttx-configs/px4-stm32f4discovery/src/Makefile
similarity index 100%
rename from nuttx-configs/px4-stm32f4discovery/src/Makefile
rename to platforms/nuttx/nuttx-configs/px4-stm32f4discovery/src/Makefile
diff --git a/nuttx-configs/px4io-v1/src/empty.c b/platforms/nuttx/nuttx-configs/px4-stm32f4discovery/src/empty.c
similarity index 100%
rename from nuttx-configs/px4io-v1/src/empty.c
rename to platforms/nuttx/nuttx-configs/px4-stm32f4discovery/src/empty.c
diff --git a/nuttx-configs/px4io-v1/include/README.txt b/platforms/nuttx/nuttx-configs/px4io-v1/include/README.txt
similarity index 100%
rename from nuttx-configs/px4io-v1/include/README.txt
rename to platforms/nuttx/nuttx-configs/px4io-v1/include/README.txt
diff --git a/nuttx-configs/px4io-v1/include/board.h b/platforms/nuttx/nuttx-configs/px4io-v1/include/board.h
similarity index 100%
rename from nuttx-configs/px4io-v1/include/board.h
rename to platforms/nuttx/nuttx-configs/px4io-v1/include/board.h
diff --git a/nuttx-configs/px4io-v1/nsh/Make.defs b/platforms/nuttx/nuttx-configs/px4io-v1/nsh/Make.defs
similarity index 100%
rename from nuttx-configs/px4io-v1/nsh/Make.defs
rename to platforms/nuttx/nuttx-configs/px4io-v1/nsh/Make.defs
diff --git a/nuttx-configs/px4io-v1/nsh/defconfig b/platforms/nuttx/nuttx-configs/px4io-v1/nsh/defconfig
similarity index 100%
rename from nuttx-configs/px4io-v1/nsh/defconfig
rename to platforms/nuttx/nuttx-configs/px4io-v1/nsh/defconfig
diff --git a/nuttx-configs/px4io-v1/nsh/setenv.sh b/platforms/nuttx/nuttx-configs/px4io-v1/nsh/setenv.sh
similarity index 100%
rename from nuttx-configs/px4io-v1/nsh/setenv.sh
rename to platforms/nuttx/nuttx-configs/px4io-v1/nsh/setenv.sh
diff --git a/nuttx-configs/px4io-v1/scripts/ld.script b/platforms/nuttx/nuttx-configs/px4io-v1/scripts/ld.script
similarity index 100%
rename from nuttx-configs/px4io-v1/scripts/ld.script
rename to platforms/nuttx/nuttx-configs/px4io-v1/scripts/ld.script
diff --git a/nuttx-configs/px4io-v1/src/Makefile b/platforms/nuttx/nuttx-configs/px4io-v1/src/Makefile
similarity index 100%
rename from nuttx-configs/px4io-v1/src/Makefile
rename to platforms/nuttx/nuttx-configs/px4io-v1/src/Makefile
diff --git a/nuttx-configs/px4io-v2/src/empty.c b/platforms/nuttx/nuttx-configs/px4io-v1/src/empty.c
similarity index 100%
rename from nuttx-configs/px4io-v2/src/empty.c
rename to platforms/nuttx/nuttx-configs/px4io-v1/src/empty.c
diff --git a/nuttx-configs/px4io-v2/include/board.h b/platforms/nuttx/nuttx-configs/px4io-v2/include/board.h
similarity index 100%
rename from nuttx-configs/px4io-v2/include/board.h
rename to platforms/nuttx/nuttx-configs/px4io-v2/include/board.h
diff --git a/nuttx-configs/px4io-v2/nsh/Make.defs b/platforms/nuttx/nuttx-configs/px4io-v2/nsh/Make.defs
similarity index 100%
rename from nuttx-configs/px4io-v2/nsh/Make.defs
rename to platforms/nuttx/nuttx-configs/px4io-v2/nsh/Make.defs
diff --git a/nuttx-configs/px4io-v2/nsh/defconfig b/platforms/nuttx/nuttx-configs/px4io-v2/nsh/defconfig
similarity index 100%
rename from nuttx-configs/px4io-v2/nsh/defconfig
rename to platforms/nuttx/nuttx-configs/px4io-v2/nsh/defconfig
diff --git a/nuttx-configs/px4io-v2/nsh/setenv.sh b/platforms/nuttx/nuttx-configs/px4io-v2/nsh/setenv.sh
similarity index 100%
rename from nuttx-configs/px4io-v2/nsh/setenv.sh
rename to platforms/nuttx/nuttx-configs/px4io-v2/nsh/setenv.sh
diff --git a/nuttx-configs/px4io-v2/scripts/ld.script b/platforms/nuttx/nuttx-configs/px4io-v2/scripts/ld.script
similarity index 100%
rename from nuttx-configs/px4io-v2/scripts/ld.script
rename to platforms/nuttx/nuttx-configs/px4io-v2/scripts/ld.script
diff --git a/nuttx-configs/px4io-v2/src/Makefile b/platforms/nuttx/nuttx-configs/px4io-v2/src/Makefile
similarity index 100%
rename from nuttx-configs/px4io-v2/src/Makefile
rename to platforms/nuttx/nuttx-configs/px4io-v2/src/Makefile
diff --git a/nuttx-configs/px4nucleoF767ZI-v1/src/empty.c b/platforms/nuttx/nuttx-configs/px4io-v2/src/empty.c
similarity index 100%
rename from nuttx-configs/px4nucleoF767ZI-v1/src/empty.c
rename to platforms/nuttx/nuttx-configs/px4io-v2/src/empty.c
diff --git a/nuttx-configs/s2740vc-v1/Kconfig b/platforms/nuttx/nuttx-configs/s2740vc-v1/Kconfig
similarity index 100%
rename from nuttx-configs/s2740vc-v1/Kconfig
rename to platforms/nuttx/nuttx-configs/s2740vc-v1/Kconfig
diff --git a/nuttx-configs/s2740vc-v1/bootloader/Make.defs b/platforms/nuttx/nuttx-configs/s2740vc-v1/bootloader/Make.defs
similarity index 100%
rename from nuttx-configs/s2740vc-v1/bootloader/Make.defs
rename to platforms/nuttx/nuttx-configs/s2740vc-v1/bootloader/Make.defs
diff --git a/nuttx-configs/s2740vc-v1/bootloader/README.txt b/platforms/nuttx/nuttx-configs/s2740vc-v1/bootloader/README.txt
similarity index 100%
rename from nuttx-configs/s2740vc-v1/bootloader/README.txt
rename to platforms/nuttx/nuttx-configs/s2740vc-v1/bootloader/README.txt
diff --git a/nuttx-configs/s2740vc-v1/bootloader/defconfig b/platforms/nuttx/nuttx-configs/s2740vc-v1/bootloader/defconfig
similarity index 100%
rename from nuttx-configs/s2740vc-v1/bootloader/defconfig
rename to platforms/nuttx/nuttx-configs/s2740vc-v1/bootloader/defconfig
diff --git a/nuttx-configs/s2740vc-v1/bootloader/setenv.sh b/platforms/nuttx/nuttx-configs/s2740vc-v1/bootloader/setenv.sh
similarity index 100%
rename from nuttx-configs/s2740vc-v1/bootloader/setenv.sh
rename to platforms/nuttx/nuttx-configs/s2740vc-v1/bootloader/setenv.sh
diff --git a/nuttx-configs/s2740vc-v1/include/README.txt b/platforms/nuttx/nuttx-configs/s2740vc-v1/include/README.txt
similarity index 100%
rename from nuttx-configs/s2740vc-v1/include/README.txt
rename to platforms/nuttx/nuttx-configs/s2740vc-v1/include/README.txt
diff --git a/nuttx-configs/s2740vc-v1/include/board.h b/platforms/nuttx/nuttx-configs/s2740vc-v1/include/board.h
similarity index 100%
rename from nuttx-configs/s2740vc-v1/include/board.h
rename to platforms/nuttx/nuttx-configs/s2740vc-v1/include/board.h
diff --git a/nuttx-configs/s2740vc-v1/nsh/IMPORTANT_README.txt b/platforms/nuttx/nuttx-configs/s2740vc-v1/nsh/IMPORTANT_README.txt
similarity index 100%
rename from nuttx-configs/s2740vc-v1/nsh/IMPORTANT_README.txt
rename to platforms/nuttx/nuttx-configs/s2740vc-v1/nsh/IMPORTANT_README.txt
diff --git a/nuttx-configs/s2740vc-v1/nsh/Make.defs b/platforms/nuttx/nuttx-configs/s2740vc-v1/nsh/Make.defs
similarity index 100%
rename from nuttx-configs/s2740vc-v1/nsh/Make.defs
rename to platforms/nuttx/nuttx-configs/s2740vc-v1/nsh/Make.defs
diff --git a/nuttx-configs/s2740vc-v1/nsh/defconfig b/platforms/nuttx/nuttx-configs/s2740vc-v1/nsh/defconfig
similarity index 100%
rename from nuttx-configs/s2740vc-v1/nsh/defconfig
rename to platforms/nuttx/nuttx-configs/s2740vc-v1/nsh/defconfig
diff --git a/nuttx-configs/s2740vc-v1/nsh/setenv.sh b/platforms/nuttx/nuttx-configs/s2740vc-v1/nsh/setenv.sh
similarity index 100%
rename from nuttx-configs/s2740vc-v1/nsh/setenv.sh
rename to platforms/nuttx/nuttx-configs/s2740vc-v1/nsh/setenv.sh
diff --git a/nuttx-configs/s2740vc-v1/scripts/bootloaderld.script b/platforms/nuttx/nuttx-configs/s2740vc-v1/scripts/bootloaderld.script
similarity index 100%
rename from nuttx-configs/s2740vc-v1/scripts/bootloaderld.script
rename to platforms/nuttx/nuttx-configs/s2740vc-v1/scripts/bootloaderld.script
diff --git a/nuttx-configs/s2740vc-v1/scripts/ld.script b/platforms/nuttx/nuttx-configs/s2740vc-v1/scripts/ld.script
similarity index 100%
rename from nuttx-configs/s2740vc-v1/scripts/ld.script
rename to platforms/nuttx/nuttx-configs/s2740vc-v1/scripts/ld.script
diff --git a/nuttx-configs/s2740vc-v1/src/Makefile b/platforms/nuttx/nuttx-configs/s2740vc-v1/src/Makefile
similarity index 100%
rename from nuttx-configs/s2740vc-v1/src/Makefile
rename to platforms/nuttx/nuttx-configs/s2740vc-v1/src/Makefile
diff --git a/nuttx-configs/s2740vc-v1/src/empty.c b/platforms/nuttx/nuttx-configs/s2740vc-v1/src/empty.c
similarity index 100%
rename from nuttx-configs/s2740vc-v1/src/empty.c
rename to platforms/nuttx/nuttx-configs/s2740vc-v1/src/empty.c
diff --git a/nuttx-configs/s2740vc-v1/src/ostubs.c b/platforms/nuttx/nuttx-configs/s2740vc-v1/src/ostubs.c
similarity index 100%
rename from nuttx-configs/s2740vc-v1/src/ostubs.c
rename to platforms/nuttx/nuttx-configs/s2740vc-v1/src/ostubs.c
diff --git a/nuttx-configs/sim/include/README.txt b/platforms/nuttx/nuttx-configs/sim/include/README.txt
similarity index 100%
rename from nuttx-configs/sim/include/README.txt
rename to platforms/nuttx/nuttx-configs/sim/include/README.txt
diff --git a/nuttx-configs/sim/include/board.h b/platforms/nuttx/nuttx-configs/sim/include/board.h
similarity index 100%
rename from nuttx-configs/sim/include/board.h
rename to platforms/nuttx/nuttx-configs/sim/include/board.h
diff --git a/nuttx-configs/sim/nsh/Make.defs b/platforms/nuttx/nuttx-configs/sim/nsh/Make.defs
similarity index 100%
rename from nuttx-configs/sim/nsh/Make.defs
rename to platforms/nuttx/nuttx-configs/sim/nsh/Make.defs
diff --git a/nuttx-configs/sim/nsh/defconfig b/platforms/nuttx/nuttx-configs/sim/nsh/defconfig
similarity index 100%
rename from nuttx-configs/sim/nsh/defconfig
rename to platforms/nuttx/nuttx-configs/sim/nsh/defconfig
diff --git a/nuttx-configs/sim/nsh/setenv.sh b/platforms/nuttx/nuttx-configs/sim/nsh/setenv.sh
similarity index 100%
rename from nuttx-configs/sim/nsh/setenv.sh
rename to platforms/nuttx/nuttx-configs/sim/nsh/setenv.sh
diff --git a/nuttx-configs/tap-v1/include/board.h b/platforms/nuttx/nuttx-configs/tap-v1/include/board.h
similarity index 100%
rename from nuttx-configs/tap-v1/include/board.h
rename to platforms/nuttx/nuttx-configs/tap-v1/include/board.h
diff --git a/nuttx-configs/tap-v1/include/nsh_romfsimg.h b/platforms/nuttx/nuttx-configs/tap-v1/include/nsh_romfsimg.h
similarity index 100%
rename from nuttx-configs/tap-v1/include/nsh_romfsimg.h
rename to platforms/nuttx/nuttx-configs/tap-v1/include/nsh_romfsimg.h
diff --git a/nuttx-configs/tap-v1/nsh/Make.defs b/platforms/nuttx/nuttx-configs/tap-v1/nsh/Make.defs
similarity index 100%
rename from nuttx-configs/tap-v1/nsh/Make.defs
rename to platforms/nuttx/nuttx-configs/tap-v1/nsh/Make.defs
diff --git a/nuttx-configs/tap-v1/nsh/defconfig b/platforms/nuttx/nuttx-configs/tap-v1/nsh/defconfig
similarity index 100%
rename from nuttx-configs/tap-v1/nsh/defconfig
rename to platforms/nuttx/nuttx-configs/tap-v1/nsh/defconfig
diff --git a/nuttx-configs/tap-v1/nsh/setenv.sh b/platforms/nuttx/nuttx-configs/tap-v1/nsh/setenv.sh
similarity index 100%
rename from nuttx-configs/tap-v1/nsh/setenv.sh
rename to platforms/nuttx/nuttx-configs/tap-v1/nsh/setenv.sh
diff --git a/nuttx-configs/tap-v1/scripts/ld.script b/platforms/nuttx/nuttx-configs/tap-v1/scripts/ld.script
similarity index 100%
rename from nuttx-configs/tap-v1/scripts/ld.script
rename to platforms/nuttx/nuttx-configs/tap-v1/scripts/ld.script
diff --git a/nuttx-configs/tap-v1/src/Makefile b/platforms/nuttx/nuttx-configs/tap-v1/src/Makefile
similarity index 100%
rename from nuttx-configs/tap-v1/src/Makefile
rename to platforms/nuttx/nuttx-configs/tap-v1/src/Makefile
diff --git a/nuttx-configs/tap-v1/src/empty.c b/platforms/nuttx/nuttx-configs/tap-v1/src/empty.c
similarity index 100%
rename from nuttx-configs/tap-v1/src/empty.c
rename to platforms/nuttx/nuttx-configs/tap-v1/src/empty.c
diff --git a/nuttx-configs/zubaxgnss-v1/Kconfig b/platforms/nuttx/nuttx-configs/zubaxgnss-v1/Kconfig
similarity index 100%
rename from nuttx-configs/zubaxgnss-v1/Kconfig
rename to platforms/nuttx/nuttx-configs/zubaxgnss-v1/Kconfig
diff --git a/nuttx-configs/zubaxgnss-v1/bootloader/Make.defs b/platforms/nuttx/nuttx-configs/zubaxgnss-v1/bootloader/Make.defs
similarity index 100%
rename from nuttx-configs/zubaxgnss-v1/bootloader/Make.defs
rename to platforms/nuttx/nuttx-configs/zubaxgnss-v1/bootloader/Make.defs
diff --git a/nuttx-configs/zubaxgnss-v1/bootloader/README.txt b/platforms/nuttx/nuttx-configs/zubaxgnss-v1/bootloader/README.txt
similarity index 100%
rename from nuttx-configs/zubaxgnss-v1/bootloader/README.txt
rename to platforms/nuttx/nuttx-configs/zubaxgnss-v1/bootloader/README.txt
diff --git a/nuttx-configs/zubaxgnss-v1/bootloader/defconfig b/platforms/nuttx/nuttx-configs/zubaxgnss-v1/bootloader/defconfig
similarity index 100%
rename from nuttx-configs/zubaxgnss-v1/bootloader/defconfig
rename to platforms/nuttx/nuttx-configs/zubaxgnss-v1/bootloader/defconfig
diff --git a/nuttx-configs/zubaxgnss-v1/bootloader/setenv.sh b/platforms/nuttx/nuttx-configs/zubaxgnss-v1/bootloader/setenv.sh
similarity index 100%
rename from nuttx-configs/zubaxgnss-v1/bootloader/setenv.sh
rename to platforms/nuttx/nuttx-configs/zubaxgnss-v1/bootloader/setenv.sh
diff --git a/nuttx-configs/zubaxgnss-v1/include/README.txt b/platforms/nuttx/nuttx-configs/zubaxgnss-v1/include/README.txt
similarity index 100%
rename from nuttx-configs/zubaxgnss-v1/include/README.txt
rename to platforms/nuttx/nuttx-configs/zubaxgnss-v1/include/README.txt
diff --git a/nuttx-configs/zubaxgnss-v1/include/board.h b/platforms/nuttx/nuttx-configs/zubaxgnss-v1/include/board.h
similarity index 100%
rename from nuttx-configs/zubaxgnss-v1/include/board.h
rename to platforms/nuttx/nuttx-configs/zubaxgnss-v1/include/board.h
diff --git a/nuttx-configs/zubaxgnss-v1/nsh/Make.defs b/platforms/nuttx/nuttx-configs/zubaxgnss-v1/nsh/Make.defs
similarity index 100%
rename from nuttx-configs/zubaxgnss-v1/nsh/Make.defs
rename to platforms/nuttx/nuttx-configs/zubaxgnss-v1/nsh/Make.defs
diff --git a/nuttx-configs/zubaxgnss-v1/nsh/defconfig b/platforms/nuttx/nuttx-configs/zubaxgnss-v1/nsh/defconfig
similarity index 100%
rename from nuttx-configs/zubaxgnss-v1/nsh/defconfig
rename to platforms/nuttx/nuttx-configs/zubaxgnss-v1/nsh/defconfig
diff --git a/nuttx-configs/zubaxgnss-v1/nsh/setenv.sh b/platforms/nuttx/nuttx-configs/zubaxgnss-v1/nsh/setenv.sh
similarity index 100%
rename from nuttx-configs/zubaxgnss-v1/nsh/setenv.sh
rename to platforms/nuttx/nuttx-configs/zubaxgnss-v1/nsh/setenv.sh
diff --git a/nuttx-configs/zubaxgnss-v1/scripts/bootloaderld.script b/platforms/nuttx/nuttx-configs/zubaxgnss-v1/scripts/bootloaderld.script
similarity index 100%
rename from nuttx-configs/zubaxgnss-v1/scripts/bootloaderld.script
rename to platforms/nuttx/nuttx-configs/zubaxgnss-v1/scripts/bootloaderld.script
diff --git a/nuttx-configs/zubaxgnss-v1/scripts/ld.script b/platforms/nuttx/nuttx-configs/zubaxgnss-v1/scripts/ld.script
similarity index 100%
rename from nuttx-configs/zubaxgnss-v1/scripts/ld.script
rename to platforms/nuttx/nuttx-configs/zubaxgnss-v1/scripts/ld.script
diff --git a/nuttx-configs/zubaxgnss-v1/src/Makefile b/platforms/nuttx/nuttx-configs/zubaxgnss-v1/src/Makefile
similarity index 100%
rename from nuttx-configs/zubaxgnss-v1/src/Makefile
rename to platforms/nuttx/nuttx-configs/zubaxgnss-v1/src/Makefile
diff --git a/nuttx-configs/zubaxgnss-v1/src/empty.c b/platforms/nuttx/nuttx-configs/zubaxgnss-v1/src/empty.c
similarity index 100%
rename from nuttx-configs/zubaxgnss-v1/src/empty.c
rename to platforms/nuttx/nuttx-configs/zubaxgnss-v1/src/empty.c
diff --git a/nuttx-configs/zubaxgnss-v1/src/ostubs.c b/platforms/nuttx/nuttx-configs/zubaxgnss-v1/src/ostubs.c
similarity index 100%
rename from nuttx-configs/zubaxgnss-v1/src/ostubs.c
rename to platforms/nuttx/nuttx-configs/zubaxgnss-v1/src/ostubs.c
diff --git a/nuttx-patches/00001-REJECTED-add-math.h.patch b/platforms/nuttx/nuttx-patches/00001-REJECTED-add-math.h.patch
similarity index 100%
rename from nuttx-patches/00001-REJECTED-add-math.h.patch
rename to platforms/nuttx/nuttx-patches/00001-REJECTED-add-math.h.patch
diff --git a/nuttx-patches/00002-REJECTED-fix-shadow-wanings.patch b/platforms/nuttx/nuttx-patches/00002-REJECTED-fix-shadow-wanings.patch
similarity index 100%
rename from nuttx-patches/00002-REJECTED-fix-shadow-wanings.patch
rename to platforms/nuttx/nuttx-patches/00002-REJECTED-fix-shadow-wanings.patch
diff --git a/nuttx-patches/00003-REJECTED-add-var-expansion-in-nsh-parse.patch b/platforms/nuttx/nuttx-patches/00003-REJECTED-add-var-expansion-in-nsh-parse.patch
similarity index 100%
rename from nuttx-patches/00003-REJECTED-add-var-expansion-in-nsh-parse.patch
rename to platforms/nuttx/nuttx-patches/00003-REJECTED-add-var-expansion-in-nsh-parse.patch
diff --git a/nuttx-patches/00004-REJECTED-avoid-export-copy-with-export-insitu.patch b/platforms/nuttx/nuttx-patches/00004-REJECTED-avoid-export-copy-with-export-insitu.patch
similarity index 100%
rename from nuttx-patches/00004-REJECTED-avoid-export-copy-with-export-insitu.patch
rename to platforms/nuttx/nuttx-patches/00004-REJECTED-avoid-export-copy-with-export-insitu.patch
diff --git a/nuttx-patches/00005-REJECTED-support-c++11.patch b/platforms/nuttx/nuttx-patches/00005-REJECTED-support-c++11.patch
similarity index 100%
rename from nuttx-patches/00005-REJECTED-support-c++11.patch
rename to platforms/nuttx/nuttx-patches/00005-REJECTED-support-c++11.patch
diff --git a/nuttx-patches/00006-REJECTED-cstdint-fix.patch b/platforms/nuttx/nuttx-patches/00006-REJECTED-cstdint-fix.patch
similarity index 100%
rename from nuttx-patches/00006-REJECTED-cstdint-fix.patch
rename to platforms/nuttx/nuttx-patches/00006-REJECTED-cstdint-fix.patch
diff --git a/nuttx-patches/00007-REJECTED-silence-jobserver-warnings.patch b/platforms/nuttx/nuttx-patches/00007-REJECTED-silence-jobserver-warnings.patch
similarity index 100%
rename from nuttx-patches/00007-REJECTED-silence-jobserver-warnings.patch
rename to platforms/nuttx/nuttx-patches/00007-REJECTED-silence-jobserver-warnings.patch
diff --git a/nuttx-patches/00008-REJECTED-static-assert-fix.patch b/platforms/nuttx/nuttx-patches/00008-REJECTED-static-assert-fix.patch
similarity index 100%
rename from nuttx-patches/00008-REJECTED-static-assert-fix.patch
rename to platforms/nuttx/nuttx-patches/00008-REJECTED-static-assert-fix.patch
diff --git a/nuttx-patches/00009-REJECTED-ctype-fix-shadow-wanings.patch b/platforms/nuttx/nuttx-patches/00009-REJECTED-ctype-fix-shadow-wanings.patch
similarity index 100%
rename from nuttx-patches/00009-REJECTED-ctype-fix-shadow-wanings.patch
rename to platforms/nuttx/nuttx-patches/00009-REJECTED-ctype-fix-shadow-wanings.patch
diff --git a/nuttx-patches/00010-BACKPORT-stm32-flash-F4-dcache-corruption-fix-no-HSI-on.patch b/platforms/nuttx/nuttx-patches/00010-BACKPORT-stm32-flash-F4-dcache-corruption-fix-no-HSI-on.patch
similarity index 100%
rename from nuttx-patches/00010-BACKPORT-stm32-flash-F4-dcache-corruption-fix-no-HSI-on.patch
rename to platforms/nuttx/nuttx-patches/00010-BACKPORT-stm32-flash-F4-dcache-corruption-fix-no-HSI-on.patch
diff --git a/nuttx-patches/00011-BACKPORT-priority-restoration-fix.patch b/platforms/nuttx/nuttx-patches/00011-BACKPORT-priority-restoration-fix.patch
similarity index 100%
rename from nuttx-patches/00011-BACKPORT-priority-restoration-fix.patch
rename to platforms/nuttx/nuttx-patches/00011-BACKPORT-priority-restoration-fix.patch
diff --git a/nuttx-patches/00012-BACKPORT-stack-coloration-overreach-fix.patch b/platforms/nuttx/nuttx-patches/00012-BACKPORT-stack-coloration-overreach-fix.patch
similarity index 100%
rename from nuttx-patches/00012-BACKPORT-stack-coloration-overreach-fix.patch
rename to platforms/nuttx/nuttx-patches/00012-BACKPORT-stack-coloration-overreach-fix.patch
diff --git a/nuttx-patches/00014-BACKPORT-i2c-hotfix.patch b/platforms/nuttx/nuttx-patches/00014-BACKPORT-i2c-hotfix.patch
similarity index 100%
rename from nuttx-patches/00014-BACKPORT-i2c-hotfix.patch
rename to platforms/nuttx/nuttx-patches/00014-BACKPORT-i2c-hotfix.patch
diff --git a/nuttx-patches/00015-BACKPORT-stm32f7-DTCM.patch b/platforms/nuttx/nuttx-patches/00015-BACKPORT-stm32f7-DTCM.patch
similarity index 100%
rename from nuttx-patches/00015-BACKPORT-stm32f7-DTCM.patch
rename to platforms/nuttx/nuttx-patches/00015-BACKPORT-stm32f7-DTCM.patch
diff --git a/nuttx-patches/00016-BACKPORT-fix-CRTSCTS-defines.patch b/platforms/nuttx/nuttx-patches/00016-BACKPORT-fix-CRTSCTS-defines.patch
similarity index 100%
rename from nuttx-patches/00016-BACKPORT-fix-CRTSCTS-defines.patch
rename to platforms/nuttx/nuttx-patches/00016-BACKPORT-fix-CRTSCTS-defines.patch
diff --git a/nuttx-patches/00017-BACKPORT-cdcacm.patch b/platforms/nuttx/nuttx-patches/00017-BACKPORT-cdcacm.patch
similarity index 100%
rename from nuttx-patches/00017-BACKPORT-cdcacm.patch
rename to platforms/nuttx/nuttx-patches/00017-BACKPORT-cdcacm.patch
diff --git a/nuttx-patches/00019-BACKPORT-stm32-rcc-keep-HSI-on.patch b/platforms/nuttx/nuttx-patches/00019-BACKPORT-stm32-rcc-keep-HSI-on.patch
similarity index 100%
rename from nuttx-patches/00019-BACKPORT-stm32-rcc-keep-HSI-on.patch
rename to platforms/nuttx/nuttx-patches/00019-BACKPORT-stm32-rcc-keep-HSI-on.patch
diff --git a/nuttx-patches/00021-BACKPORT-stm32f3x-add-BKP.patch b/platforms/nuttx/nuttx-patches/00021-BACKPORT-stm32f3x-add-BKP.patch
similarity index 100%
rename from nuttx-patches/00021-BACKPORT-stm32f3x-add-BKP.patch
rename to platforms/nuttx/nuttx-patches/00021-BACKPORT-stm32f3x-add-BKP.patch
diff --git a/nuttx-patches/00022-BACKPORT-stm32-bkp-reference-fix.patch b/platforms/nuttx/nuttx-patches/00022-BACKPORT-stm32-bkp-reference-fix.patch
similarity index 100%
rename from nuttx-patches/00022-BACKPORT-stm32-bkp-reference-fix.patch
rename to platforms/nuttx/nuttx-patches/00022-BACKPORT-stm32-bkp-reference-fix.patch
diff --git a/nuttx-patches/00023-BACKPORT-stm32f7-bkp-reference-fix.patch b/platforms/nuttx/nuttx-patches/00023-BACKPORT-stm32f7-bkp-reference-fix.patch
similarity index 100%
rename from nuttx-patches/00023-BACKPORT-stm32f7-bkp-reference-fix.patch
rename to platforms/nuttx/nuttx-patches/00023-BACKPORT-stm32f7-bkp-reference-fix.patch
diff --git a/nuttx-patches/00024-BACKPORT-stm32f7-serial-dma-hotfix.patch b/platforms/nuttx/nuttx-patches/00024-BACKPORT-stm32f7-serial-dma-hotfix.patch
similarity index 100%
rename from nuttx-patches/00024-BACKPORT-stm32f7-serial-dma-hotfix.patch
rename to platforms/nuttx/nuttx-patches/00024-BACKPORT-stm32f7-serial-dma-hotfix.patch
diff --git a/nuttx-patches/00025-BACKPORT-add-set-ex-to-nsh.patch b/platforms/nuttx/nuttx-patches/00025-BACKPORT-add-set-ex-to-nsh.patch
similarity index 100%
rename from nuttx-patches/00025-BACKPORT-add-set-ex-to-nsh.patch
rename to platforms/nuttx/nuttx-patches/00025-BACKPORT-add-set-ex-to-nsh.patch
diff --git a/nuttx-patches/00026-BACKPORT-stm32fX-serial-fix-freezing.patch b/platforms/nuttx/nuttx-patches/00026-BACKPORT-stm32fX-serial-fix-freezing.patch
similarity index 100%
rename from nuttx-patches/00026-BACKPORT-stm32fX-serial-fix-freezing.patch
rename to platforms/nuttx/nuttx-patches/00026-BACKPORT-stm32fX-serial-fix-freezing.patch
diff --git a/nuttx-patches/00027-BACKPORT-stm32-sdio-1-bit-and-16G-fix.patch b/platforms/nuttx/nuttx-patches/00027-BACKPORT-stm32-sdio-1-bit-and-16G-fix.patch
similarity index 100%
rename from nuttx-patches/00027-BACKPORT-stm32-sdio-1-bit-and-16G-fix.patch
rename to platforms/nuttx/nuttx-patches/00027-BACKPORT-stm32-sdio-1-bit-and-16G-fix.patch
diff --git a/nuttx-patches/00028-BACKPORT-mtd-FLASH-corruption.patch b/platforms/nuttx/nuttx-patches/00028-BACKPORT-mtd-FLASH-corruption.patch
similarity index 100%
rename from nuttx-patches/00028-BACKPORT-mtd-FLASH-corruption.patch
rename to platforms/nuttx/nuttx-patches/00028-BACKPORT-mtd-FLASH-corruption.patch
diff --git a/nuttx-patches/00029-BACKPORT-stm32-serial-upstream-sans-IRQ.patch b/platforms/nuttx/nuttx-patches/00029-BACKPORT-stm32-serial-upstream-sans-IRQ.patch
similarity index 100%
rename from nuttx-patches/00029-BACKPORT-stm32-serial-upstream-sans-IRQ.patch
rename to platforms/nuttx/nuttx-patches/00029-BACKPORT-stm32-serial-upstream-sans-IRQ.patch
diff --git a/nuttx-patches/00030-BACKPORT-fix-arm-none-eabi-gcc-7-warnings-nuttx.patch b/platforms/nuttx/nuttx-patches/00030-BACKPORT-fix-arm-none-eabi-gcc-7-warnings-nuttx.patch
similarity index 100%
rename from nuttx-patches/00030-BACKPORT-fix-arm-none-eabi-gcc-7-warnings-nuttx.patch
rename to platforms/nuttx/nuttx-patches/00030-BACKPORT-fix-arm-none-eabi-gcc-7-warnings-nuttx.patch
diff --git a/nuttx-patches/00031-BACKPORT-fix-arm-none-eabi-gcc-7-warnings-apps.patch b/platforms/nuttx/nuttx-patches/00031-BACKPORT-fix-arm-none-eabi-gcc-7-warnings-apps.patch
similarity index 100%
rename from nuttx-patches/00031-BACKPORT-fix-arm-none-eabi-gcc-7-warnings-apps.patch
rename to platforms/nuttx/nuttx-patches/00031-BACKPORT-fix-arm-none-eabi-gcc-7-warnings-apps.patch
diff --git a/nuttx-patches/00032-BACKPORT-stm32f7-pinmap-FMC-I2C4-fixes.patch b/platforms/nuttx/nuttx-patches/00032-BACKPORT-stm32f7-pinmap-FMC-I2C4-fixes.patch
similarity index 100%
rename from nuttx-patches/00032-BACKPORT-stm32f7-pinmap-FMC-I2C4-fixes.patch
rename to platforms/nuttx/nuttx-patches/00032-BACKPORT-stm32f7-pinmap-FMC-I2C4-fixes.patch
diff --git a/nuttx-patches/90000-PENDING-wip-inflight-to-upstream.patch b/platforms/nuttx/nuttx-patches/90000-PENDING-wip-inflight-to-upstream.patch
similarity index 100%
rename from nuttx-patches/90000-PENDING-wip-inflight-to-upstream.patch
rename to platforms/nuttx/nuttx-patches/90000-PENDING-wip-inflight-to-upstream.patch
diff --git a/nuttx-patches/CMakeLists.txt b/platforms/nuttx/nuttx-patches/CMakeLists.txt
similarity index 100%
rename from nuttx-patches/CMakeLists.txt
rename to platforms/nuttx/nuttx-patches/CMakeLists.txt
diff --git a/src/drivers/aerofc_adc/CMakeLists.txt b/platforms/nuttx/src/drivers/aerofc_adc/CMakeLists.txt
similarity index 100%
rename from src/drivers/aerofc_adc/CMakeLists.txt
rename to platforms/nuttx/src/drivers/aerofc_adc/CMakeLists.txt
diff --git a/src/drivers/aerofc_adc/aerofc_adc.cpp b/platforms/nuttx/src/drivers/aerofc_adc/aerofc_adc.cpp
similarity index 100%
rename from src/drivers/aerofc_adc/aerofc_adc.cpp
rename to platforms/nuttx/src/drivers/aerofc_adc/aerofc_adc.cpp
diff --git a/src/drivers/batt_smbus/CMakeLists.txt b/platforms/nuttx/src/drivers/batt_smbus/CMakeLists.txt
similarity index 100%
rename from src/drivers/batt_smbus/CMakeLists.txt
rename to platforms/nuttx/src/drivers/batt_smbus/CMakeLists.txt
diff --git a/src/drivers/batt_smbus/batt_smbus.cpp b/platforms/nuttx/src/drivers/batt_smbus/batt_smbus.cpp
similarity index 100%
rename from src/drivers/batt_smbus/batt_smbus.cpp
rename to platforms/nuttx/src/drivers/batt_smbus/batt_smbus.cpp
diff --git a/src/drivers/bma180/CMakeLists.txt b/platforms/nuttx/src/drivers/bma180/CMakeLists.txt
similarity index 100%
rename from src/drivers/bma180/CMakeLists.txt
rename to platforms/nuttx/src/drivers/bma180/CMakeLists.txt
diff --git a/src/drivers/bma180/bma180.cpp b/platforms/nuttx/src/drivers/bma180/bma180.cpp
similarity index 100%
rename from src/drivers/bma180/bma180.cpp
rename to platforms/nuttx/src/drivers/bma180/bma180.cpp
diff --git a/src/drivers/bmi055/CMakeLists.txt b/platforms/nuttx/src/drivers/bmi055/CMakeLists.txt
similarity index 100%
rename from src/drivers/bmi055/CMakeLists.txt
rename to platforms/nuttx/src/drivers/bmi055/CMakeLists.txt
diff --git a/src/drivers/bmi055/bmi055.hpp b/platforms/nuttx/src/drivers/bmi055/bmi055.hpp
similarity index 100%
rename from src/drivers/bmi055/bmi055.hpp
rename to platforms/nuttx/src/drivers/bmi055/bmi055.hpp
diff --git a/src/drivers/bmi055/bmi055_accel.cpp b/platforms/nuttx/src/drivers/bmi055/bmi055_accel.cpp
similarity index 100%
rename from src/drivers/bmi055/bmi055_accel.cpp
rename to platforms/nuttx/src/drivers/bmi055/bmi055_accel.cpp
diff --git a/src/drivers/bmi055/bmi055_gyro.cpp b/platforms/nuttx/src/drivers/bmi055/bmi055_gyro.cpp
similarity index 100%
rename from src/drivers/bmi055/bmi055_gyro.cpp
rename to platforms/nuttx/src/drivers/bmi055/bmi055_gyro.cpp
diff --git a/src/drivers/bmi055/bmi055_main.cpp b/platforms/nuttx/src/drivers/bmi055/bmi055_main.cpp
similarity index 100%
rename from src/drivers/bmi055/bmi055_main.cpp
rename to platforms/nuttx/src/drivers/bmi055/bmi055_main.cpp
diff --git a/src/drivers/bmi160/CMakeLists.txt b/platforms/nuttx/src/drivers/bmi160/CMakeLists.txt
similarity index 100%
rename from src/drivers/bmi160/CMakeLists.txt
rename to platforms/nuttx/src/drivers/bmi160/CMakeLists.txt
diff --git a/src/drivers/bmi160/bmi160.cpp b/platforms/nuttx/src/drivers/bmi160/bmi160.cpp
similarity index 100%
rename from src/drivers/bmi160/bmi160.cpp
rename to platforms/nuttx/src/drivers/bmi160/bmi160.cpp
diff --git a/src/drivers/bmi160/bmi160.hpp b/platforms/nuttx/src/drivers/bmi160/bmi160.hpp
similarity index 100%
rename from src/drivers/bmi160/bmi160.hpp
rename to platforms/nuttx/src/drivers/bmi160/bmi160.hpp
diff --git a/src/drivers/bmi160/bmi160_gyro.cpp b/platforms/nuttx/src/drivers/bmi160/bmi160_gyro.cpp
similarity index 100%
rename from src/drivers/bmi160/bmi160_gyro.cpp
rename to platforms/nuttx/src/drivers/bmi160/bmi160_gyro.cpp
diff --git a/src/drivers/bmi160/bmi160_gyro.hpp b/platforms/nuttx/src/drivers/bmi160/bmi160_gyro.hpp
similarity index 100%
rename from src/drivers/bmi160/bmi160_gyro.hpp
rename to platforms/nuttx/src/drivers/bmi160/bmi160_gyro.hpp
diff --git a/src/drivers/bmi160/bmi160_main.cpp b/platforms/nuttx/src/drivers/bmi160/bmi160_main.cpp
similarity index 100%
rename from src/drivers/bmi160/bmi160_main.cpp
rename to platforms/nuttx/src/drivers/bmi160/bmi160_main.cpp
diff --git a/src/drivers/bmm150/CMakeLists.txt b/platforms/nuttx/src/drivers/bmm150/CMakeLists.txt
similarity index 100%
rename from src/drivers/bmm150/CMakeLists.txt
rename to platforms/nuttx/src/drivers/bmm150/CMakeLists.txt
diff --git a/src/drivers/bmm150/bmm150.cpp b/platforms/nuttx/src/drivers/bmm150/bmm150.cpp
similarity index 100%
rename from src/drivers/bmm150/bmm150.cpp
rename to platforms/nuttx/src/drivers/bmm150/bmm150.cpp
diff --git a/src/drivers/bmm150/bmm150.hpp b/platforms/nuttx/src/drivers/bmm150/bmm150.hpp
similarity index 100%
rename from src/drivers/bmm150/bmm150.hpp
rename to platforms/nuttx/src/drivers/bmm150/bmm150.hpp
diff --git a/src/drivers/bmp280/CMakeLists.txt b/platforms/nuttx/src/drivers/bmp280/CMakeLists.txt
similarity index 100%
rename from src/drivers/bmp280/CMakeLists.txt
rename to platforms/nuttx/src/drivers/bmp280/CMakeLists.txt
diff --git a/src/drivers/bmp280/bmp280.cpp b/platforms/nuttx/src/drivers/bmp280/bmp280.cpp
similarity index 100%
rename from src/drivers/bmp280/bmp280.cpp
rename to platforms/nuttx/src/drivers/bmp280/bmp280.cpp
diff --git a/src/drivers/bmp280/bmp280.h b/platforms/nuttx/src/drivers/bmp280/bmp280.h
similarity index 100%
rename from src/drivers/bmp280/bmp280.h
rename to platforms/nuttx/src/drivers/bmp280/bmp280.h
diff --git a/src/drivers/bmp280/bmp280_i2c.cpp b/platforms/nuttx/src/drivers/bmp280/bmp280_i2c.cpp
similarity index 100%
rename from src/drivers/bmp280/bmp280_i2c.cpp
rename to platforms/nuttx/src/drivers/bmp280/bmp280_i2c.cpp
diff --git a/src/drivers/bmp280/bmp280_spi.cpp b/platforms/nuttx/src/drivers/bmp280/bmp280_spi.cpp
similarity index 100%
rename from src/drivers/bmp280/bmp280_spi.cpp
rename to platforms/nuttx/src/drivers/bmp280/bmp280_spi.cpp
diff --git a/src/drivers/boards/aerocore/CMakeLists.txt b/platforms/nuttx/src/drivers/boards/aerocore/CMakeLists.txt
similarity index 100%
rename from src/drivers/boards/aerocore/CMakeLists.txt
rename to platforms/nuttx/src/drivers/boards/aerocore/CMakeLists.txt
diff --git a/src/drivers/boards/aerocore/aerocore_init.c b/platforms/nuttx/src/drivers/boards/aerocore/aerocore_init.c
similarity index 100%
rename from src/drivers/boards/aerocore/aerocore_init.c
rename to platforms/nuttx/src/drivers/boards/aerocore/aerocore_init.c
diff --git a/src/drivers/boards/aerocore/aerocore_led.c b/platforms/nuttx/src/drivers/boards/aerocore/aerocore_led.c
similarity index 100%
rename from src/drivers/boards/aerocore/aerocore_led.c
rename to platforms/nuttx/src/drivers/boards/aerocore/aerocore_led.c
diff --git a/src/drivers/boards/aerocore/aerocore_spi.c b/platforms/nuttx/src/drivers/boards/aerocore/aerocore_spi.c
similarity index 100%
rename from src/drivers/boards/aerocore/aerocore_spi.c
rename to platforms/nuttx/src/drivers/boards/aerocore/aerocore_spi.c
diff --git a/src/drivers/boards/aerocore/aerocore_timer_config.c b/platforms/nuttx/src/drivers/boards/aerocore/aerocore_timer_config.c
similarity index 100%
rename from src/drivers/boards/aerocore/aerocore_timer_config.c
rename to platforms/nuttx/src/drivers/boards/aerocore/aerocore_timer_config.c
diff --git a/src/drivers/boards/aerocore/board_config.h b/platforms/nuttx/src/drivers/boards/aerocore/board_config.h
similarity index 99%
rename from src/drivers/boards/aerocore/board_config.h
rename to platforms/nuttx/src/drivers/boards/aerocore/board_config.h
index 9b0d066c9792..cb35758e128c 100644
--- a/src/drivers/boards/aerocore/board_config.h
+++ b/platforms/nuttx/src/drivers/boards/aerocore/board_config.h
@@ -235,7 +235,7 @@ extern void stm32_spiinitialize(void);
#define board_peripheral_reset(ms)
-#include "../common/board_common.h"
+#include "common/board_common.h"
#endif /* __ASSEMBLY__ */
diff --git a/src/drivers/boards/aerocore2/CMakeLists.txt b/platforms/nuttx/src/drivers/boards/aerocore2/CMakeLists.txt
similarity index 100%
rename from src/drivers/boards/aerocore2/CMakeLists.txt
rename to platforms/nuttx/src/drivers/boards/aerocore2/CMakeLists.txt
diff --git a/src/drivers/boards/aerocore2/aerocore2_can.c b/platforms/nuttx/src/drivers/boards/aerocore2/aerocore2_can.c
similarity index 100%
rename from src/drivers/boards/aerocore2/aerocore2_can.c
rename to platforms/nuttx/src/drivers/boards/aerocore2/aerocore2_can.c
diff --git a/src/drivers/boards/aerocore2/aerocore2_init.c b/platforms/nuttx/src/drivers/boards/aerocore2/aerocore2_init.c
similarity index 100%
rename from src/drivers/boards/aerocore2/aerocore2_init.c
rename to platforms/nuttx/src/drivers/boards/aerocore2/aerocore2_init.c
diff --git a/src/drivers/boards/aerocore2/aerocore2_led.c b/platforms/nuttx/src/drivers/boards/aerocore2/aerocore2_led.c
similarity index 100%
rename from src/drivers/boards/aerocore2/aerocore2_led.c
rename to platforms/nuttx/src/drivers/boards/aerocore2/aerocore2_led.c
diff --git a/src/drivers/boards/aerocore2/aerocore2_spi.c b/platforms/nuttx/src/drivers/boards/aerocore2/aerocore2_spi.c
similarity index 100%
rename from src/drivers/boards/aerocore2/aerocore2_spi.c
rename to platforms/nuttx/src/drivers/boards/aerocore2/aerocore2_spi.c
diff --git a/src/drivers/boards/aerocore2/aerocore2_timer_config.c b/platforms/nuttx/src/drivers/boards/aerocore2/aerocore2_timer_config.c
similarity index 100%
rename from src/drivers/boards/aerocore2/aerocore2_timer_config.c
rename to platforms/nuttx/src/drivers/boards/aerocore2/aerocore2_timer_config.c
diff --git a/src/drivers/boards/aerocore2/aerocore2_usb.c b/platforms/nuttx/src/drivers/boards/aerocore2/aerocore2_usb.c
similarity index 100%
rename from src/drivers/boards/aerocore2/aerocore2_usb.c
rename to platforms/nuttx/src/drivers/boards/aerocore2/aerocore2_usb.c
diff --git a/src/drivers/boards/aerocore2/board_config.h b/platforms/nuttx/src/drivers/boards/aerocore2/board_config.h
similarity index 99%
rename from src/drivers/boards/aerocore2/board_config.h
rename to platforms/nuttx/src/drivers/boards/aerocore2/board_config.h
index 4a09792cddc3..87be37151520 100644
--- a/src/drivers/boards/aerocore2/board_config.h
+++ b/platforms/nuttx/src/drivers/boards/aerocore2/board_config.h
@@ -254,7 +254,7 @@ extern void board_spi_reset(int ms);
extern void stm32_usbinitialize(void);
extern void board_peripheral_reset(int ms);
-#include "../common/board_common.h"
+#include "common/board_common.h"
#endif /* __ASSEMBLY__ */
diff --git a/src/drivers/boards/aerofc-v1/CMakeLists.txt b/platforms/nuttx/src/drivers/boards/aerofc-v1/CMakeLists.txt
similarity index 100%
rename from src/drivers/boards/aerofc-v1/CMakeLists.txt
rename to platforms/nuttx/src/drivers/boards/aerofc-v1/CMakeLists.txt
diff --git a/src/drivers/boards/aerofc-v1/aerofc_init.c b/platforms/nuttx/src/drivers/boards/aerofc-v1/aerofc_init.c
similarity index 100%
rename from src/drivers/boards/aerofc-v1/aerofc_init.c
rename to platforms/nuttx/src/drivers/boards/aerofc-v1/aerofc_init.c
diff --git a/src/drivers/boards/aerofc-v1/aerofc_led.c b/platforms/nuttx/src/drivers/boards/aerofc-v1/aerofc_led.c
similarity index 100%
rename from src/drivers/boards/aerofc-v1/aerofc_led.c
rename to platforms/nuttx/src/drivers/boards/aerofc-v1/aerofc_led.c
diff --git a/src/drivers/boards/aerofc-v1/aerofc_spi.c b/platforms/nuttx/src/drivers/boards/aerofc-v1/aerofc_spi.c
similarity index 100%
rename from src/drivers/boards/aerofc-v1/aerofc_spi.c
rename to platforms/nuttx/src/drivers/boards/aerofc-v1/aerofc_spi.c
diff --git a/src/drivers/boards/aerofc-v1/aerofc_timer_config.c b/platforms/nuttx/src/drivers/boards/aerofc-v1/aerofc_timer_config.c
similarity index 100%
rename from src/drivers/boards/aerofc-v1/aerofc_timer_config.c
rename to platforms/nuttx/src/drivers/boards/aerofc-v1/aerofc_timer_config.c
diff --git a/src/drivers/boards/aerofc-v1/board_config.h b/platforms/nuttx/src/drivers/boards/aerofc-v1/board_config.h
similarity index 99%
rename from src/drivers/boards/aerofc-v1/board_config.h
rename to platforms/nuttx/src/drivers/boards/aerofc-v1/board_config.h
index 1d1e958d56bc..2aef7e8e65a3 100644
--- a/src/drivers/boards/aerofc-v1/board_config.h
+++ b/platforms/nuttx/src/drivers/boards/aerofc-v1/board_config.h
@@ -187,7 +187,7 @@ extern void stm32_spiinitialize(void);
extern int board_sdio_initialize(void);
-#include "../common/board_common.h"
+#include "common/board_common.h"
#endif /* __ASSEMBLY__ */
diff --git a/src/drivers/boards/auav-x21/CMakeLists.txt b/platforms/nuttx/src/drivers/boards/auav-x21/CMakeLists.txt
similarity index 100%
rename from src/drivers/boards/auav-x21/CMakeLists.txt
rename to platforms/nuttx/src/drivers/boards/auav-x21/CMakeLists.txt
diff --git a/src/drivers/boards/auav-x21/auav_can.c b/platforms/nuttx/src/drivers/boards/auav-x21/auav_can.c
similarity index 100%
rename from src/drivers/boards/auav-x21/auav_can.c
rename to platforms/nuttx/src/drivers/boards/auav-x21/auav_can.c
diff --git a/src/drivers/boards/auav-x21/auav_init.c b/platforms/nuttx/src/drivers/boards/auav-x21/auav_init.c
similarity index 100%
rename from src/drivers/boards/auav-x21/auav_init.c
rename to platforms/nuttx/src/drivers/boards/auav-x21/auav_init.c
diff --git a/src/drivers/boards/auav-x21/auav_led.c b/platforms/nuttx/src/drivers/boards/auav-x21/auav_led.c
similarity index 100%
rename from src/drivers/boards/auav-x21/auav_led.c
rename to platforms/nuttx/src/drivers/boards/auav-x21/auav_led.c
diff --git a/src/drivers/boards/auav-x21/auav_spi.c b/platforms/nuttx/src/drivers/boards/auav-x21/auav_spi.c
similarity index 100%
rename from src/drivers/boards/auav-x21/auav_spi.c
rename to platforms/nuttx/src/drivers/boards/auav-x21/auav_spi.c
diff --git a/src/drivers/boards/auav-x21/auav_timer_config.c b/platforms/nuttx/src/drivers/boards/auav-x21/auav_timer_config.c
similarity index 100%
rename from src/drivers/boards/auav-x21/auav_timer_config.c
rename to platforms/nuttx/src/drivers/boards/auav-x21/auav_timer_config.c
diff --git a/src/drivers/boards/auav-x21/auav_usb.c b/platforms/nuttx/src/drivers/boards/auav-x21/auav_usb.c
similarity index 100%
rename from src/drivers/boards/auav-x21/auav_usb.c
rename to platforms/nuttx/src/drivers/boards/auav-x21/auav_usb.c
diff --git a/src/drivers/boards/common/board_crashdump.c b/platforms/nuttx/src/drivers/boards/common/board_crashdump.c
similarity index 100%
rename from src/drivers/boards/common/board_crashdump.c
rename to platforms/nuttx/src/drivers/boards/common/board_crashdump.c
diff --git a/src/drivers/boards/common/board_dma_alloc.c b/platforms/nuttx/src/drivers/boards/common/board_dma_alloc.c
similarity index 100%
rename from src/drivers/boards/common/board_dma_alloc.c
rename to platforms/nuttx/src/drivers/boards/common/board_dma_alloc.c
diff --git a/src/drivers/boards/common/board_gpio_init.c b/platforms/nuttx/src/drivers/boards/common/board_gpio_init.c
similarity index 100%
rename from src/drivers/boards/common/board_gpio_init.c
rename to platforms/nuttx/src/drivers/boards/common/board_gpio_init.c
diff --git a/src/drivers/boards/common/stm32/board_identity.c b/platforms/nuttx/src/drivers/boards/common/stm32/board_identity.c
similarity index 100%
rename from src/drivers/boards/common/stm32/board_identity.c
rename to platforms/nuttx/src/drivers/boards/common/stm32/board_identity.c
diff --git a/src/drivers/boards/common/stm32/board_mcu_version.c b/platforms/nuttx/src/drivers/boards/common/stm32/board_mcu_version.c
similarity index 100%
rename from src/drivers/boards/common/stm32/board_mcu_version.c
rename to platforms/nuttx/src/drivers/boards/common/stm32/board_mcu_version.c
diff --git a/src/drivers/boards/common/stm32/board_reset.c b/platforms/nuttx/src/drivers/boards/common/stm32/board_reset.c
similarity index 100%
rename from src/drivers/boards/common/stm32/board_reset.c
rename to platforms/nuttx/src/drivers/boards/common/stm32/board_reset.c
diff --git a/src/drivers/boards/crazyflie/CMakeLists.txt b/platforms/nuttx/src/drivers/boards/crazyflie/CMakeLists.txt
similarity index 100%
rename from src/drivers/boards/crazyflie/CMakeLists.txt
rename to platforms/nuttx/src/drivers/boards/crazyflie/CMakeLists.txt
diff --git a/src/drivers/boards/crazyflie/crazyflie_init.c b/platforms/nuttx/src/drivers/boards/crazyflie/crazyflie_init.c
similarity index 100%
rename from src/drivers/boards/crazyflie/crazyflie_init.c
rename to platforms/nuttx/src/drivers/boards/crazyflie/crazyflie_init.c
diff --git a/src/drivers/boards/crazyflie/crazyflie_led.c b/platforms/nuttx/src/drivers/boards/crazyflie/crazyflie_led.c
similarity index 100%
rename from src/drivers/boards/crazyflie/crazyflie_led.c
rename to platforms/nuttx/src/drivers/boards/crazyflie/crazyflie_led.c
diff --git a/src/drivers/boards/crazyflie/crazyflie_timer_config.c b/platforms/nuttx/src/drivers/boards/crazyflie/crazyflie_timer_config.c
similarity index 100%
rename from src/drivers/boards/crazyflie/crazyflie_timer_config.c
rename to platforms/nuttx/src/drivers/boards/crazyflie/crazyflie_timer_config.c
diff --git a/src/drivers/boards/crazyflie/crazyflie_usb.c b/platforms/nuttx/src/drivers/boards/crazyflie/crazyflie_usb.c
similarity index 100%
rename from src/drivers/boards/crazyflie/crazyflie_usb.c
rename to platforms/nuttx/src/drivers/boards/crazyflie/crazyflie_usb.c
diff --git a/src/drivers/boards/esc35-v1/CMakeLists.txt b/platforms/nuttx/src/drivers/boards/esc35-v1/CMakeLists.txt
similarity index 100%
rename from src/drivers/boards/esc35-v1/CMakeLists.txt
rename to platforms/nuttx/src/drivers/boards/esc35-v1/CMakeLists.txt
diff --git a/src/drivers/boards/esc35-v1/bootloader/CMakeLists.txt b/platforms/nuttx/src/drivers/boards/esc35-v1/bootloader/CMakeLists.txt
similarity index 94%
rename from src/drivers/boards/esc35-v1/bootloader/CMakeLists.txt
rename to platforms/nuttx/src/drivers/boards/esc35-v1/bootloader/CMakeLists.txt
index 710bba55b31f..687d45dfa8d3 100644
--- a/src/drivers/boards/esc35-v1/bootloader/CMakeLists.txt
+++ b/platforms/nuttx/src/drivers/boards/esc35-v1/bootloader/CMakeLists.txt
@@ -39,7 +39,8 @@ add_definitions(
)
include_directories(${px4_bootloader_base}include)
-include_directories(${px4_module_base}systemlib)
+include_directories(${PX4_SOURCE_DIR}/platforms/nuttx/src/modules/systemlib)
+include_directories(${PX4_SOURCE_DIR}/src/modules/systemlib)
include_directories(.)
px4_add_module(
diff --git a/src/drivers/boards/esc35-v1/bootloader/boot.c b/platforms/nuttx/src/drivers/boards/esc35-v1/bootloader/boot.c
similarity index 100%
rename from src/drivers/boards/esc35-v1/bootloader/boot.c
rename to platforms/nuttx/src/drivers/boards/esc35-v1/bootloader/boot.c
diff --git a/src/drivers/boards/esc35-v1/bootloader/boot_config.h b/platforms/nuttx/src/drivers/boards/esc35-v1/bootloader/boot_config.h
similarity index 99%
rename from src/drivers/boards/esc35-v1/bootloader/boot_config.h
rename to platforms/nuttx/src/drivers/boards/esc35-v1/bootloader/boot_config.h
index 073e50cc8dc0..e2d0c387d9a3 100644
--- a/src/drivers/boards/esc35-v1/bootloader/boot_config.h
+++ b/platforms/nuttx/src/drivers/boards/esc35-v1/bootloader/boot_config.h
@@ -51,7 +51,7 @@
* todo:make this be pulled in from a targed's build
* files in nuttx*/
-#include "../board_config.h"
+#include "board_config.h"
#include "uavcan.h"
#include
#include
diff --git a/src/drivers/boards/esc35-v1/bootloader/led.c b/platforms/nuttx/src/drivers/boards/esc35-v1/bootloader/led.c
similarity index 100%
rename from src/drivers/boards/esc35-v1/bootloader/led.c
rename to platforms/nuttx/src/drivers/boards/esc35-v1/bootloader/led.c
diff --git a/src/drivers/boards/esc35-v1/bootloader/led.h b/platforms/nuttx/src/drivers/boards/esc35-v1/bootloader/led.h
similarity index 100%
rename from src/drivers/boards/esc35-v1/bootloader/led.h
rename to platforms/nuttx/src/drivers/boards/esc35-v1/bootloader/led.h
diff --git a/src/drivers/boards/esc35-v1/esc35_init.c b/platforms/nuttx/src/drivers/boards/esc35-v1/esc35_init.c
similarity index 100%
rename from src/drivers/boards/esc35-v1/esc35_init.c
rename to platforms/nuttx/src/drivers/boards/esc35-v1/esc35_init.c
diff --git a/src/drivers/boards/esc35-v1/esc35_led.c b/platforms/nuttx/src/drivers/boards/esc35-v1/esc35_led.c
similarity index 100%
rename from src/drivers/boards/esc35-v1/esc35_led.c
rename to platforms/nuttx/src/drivers/boards/esc35-v1/esc35_led.c
diff --git a/src/drivers/boards/esc35-v1/esc35_usb.c b/platforms/nuttx/src/drivers/boards/esc35-v1/esc35_usb.c
similarity index 100%
rename from src/drivers/boards/esc35-v1/esc35_usb.c
rename to platforms/nuttx/src/drivers/boards/esc35-v1/esc35_usb.c
diff --git a/src/drivers/boards/mindpx-v2/CMakeLists.txt b/platforms/nuttx/src/drivers/boards/mindpx-v2/CMakeLists.txt
similarity index 100%
rename from src/drivers/boards/mindpx-v2/CMakeLists.txt
rename to platforms/nuttx/src/drivers/boards/mindpx-v2/CMakeLists.txt
diff --git a/src/drivers/boards/mindpx-v2/mindpx2_init.c b/platforms/nuttx/src/drivers/boards/mindpx-v2/mindpx2_init.c
similarity index 100%
rename from src/drivers/boards/mindpx-v2/mindpx2_init.c
rename to platforms/nuttx/src/drivers/boards/mindpx-v2/mindpx2_init.c
diff --git a/src/drivers/boards/mindpx-v2/mindpx2_led.c b/platforms/nuttx/src/drivers/boards/mindpx-v2/mindpx2_led.c
similarity index 100%
rename from src/drivers/boards/mindpx-v2/mindpx2_led.c
rename to platforms/nuttx/src/drivers/boards/mindpx-v2/mindpx2_led.c
diff --git a/src/drivers/boards/mindpx-v2/mindpx_can.c b/platforms/nuttx/src/drivers/boards/mindpx-v2/mindpx_can.c
similarity index 100%
rename from src/drivers/boards/mindpx-v2/mindpx_can.c
rename to platforms/nuttx/src/drivers/boards/mindpx-v2/mindpx_can.c
diff --git a/src/drivers/boards/mindpx-v2/mindpx_spi.c b/platforms/nuttx/src/drivers/boards/mindpx-v2/mindpx_spi.c
similarity index 100%
rename from src/drivers/boards/mindpx-v2/mindpx_spi.c
rename to platforms/nuttx/src/drivers/boards/mindpx-v2/mindpx_spi.c
diff --git a/src/drivers/boards/mindpx-v2/mindpx_timer_config.c b/platforms/nuttx/src/drivers/boards/mindpx-v2/mindpx_timer_config.c
similarity index 100%
rename from src/drivers/boards/mindpx-v2/mindpx_timer_config.c
rename to platforms/nuttx/src/drivers/boards/mindpx-v2/mindpx_timer_config.c
diff --git a/src/drivers/boards/mindpx-v2/mindpx_usb.c b/platforms/nuttx/src/drivers/boards/mindpx-v2/mindpx_usb.c
similarity index 100%
rename from src/drivers/boards/mindpx-v2/mindpx_usb.c
rename to platforms/nuttx/src/drivers/boards/mindpx-v2/mindpx_usb.c
diff --git a/src/drivers/boards/px4-stm32f4discovery/CMakeLists.txt b/platforms/nuttx/src/drivers/boards/px4-stm32f4discovery/CMakeLists.txt
similarity index 100%
rename from src/drivers/boards/px4-stm32f4discovery/CMakeLists.txt
rename to platforms/nuttx/src/drivers/boards/px4-stm32f4discovery/CMakeLists.txt
diff --git a/src/drivers/boards/px4-stm32f4discovery/px4discovery_init.c b/platforms/nuttx/src/drivers/boards/px4-stm32f4discovery/px4discovery_init.c
similarity index 100%
rename from src/drivers/boards/px4-stm32f4discovery/px4discovery_init.c
rename to platforms/nuttx/src/drivers/boards/px4-stm32f4discovery/px4discovery_init.c
diff --git a/src/drivers/boards/px4-stm32f4discovery/px4discovery_led.c b/platforms/nuttx/src/drivers/boards/px4-stm32f4discovery/px4discovery_led.c
similarity index 100%
rename from src/drivers/boards/px4-stm32f4discovery/px4discovery_led.c
rename to platforms/nuttx/src/drivers/boards/px4-stm32f4discovery/px4discovery_led.c
diff --git a/src/drivers/boards/px4-stm32f4discovery/px4discovery_usb.c b/platforms/nuttx/src/drivers/boards/px4-stm32f4discovery/px4discovery_usb.c
similarity index 100%
rename from src/drivers/boards/px4-stm32f4discovery/px4discovery_usb.c
rename to platforms/nuttx/src/drivers/boards/px4-stm32f4discovery/px4discovery_usb.c
diff --git a/src/drivers/boards/px4cannode-v1/CMakeLists.txt b/platforms/nuttx/src/drivers/boards/px4cannode-v1/CMakeLists.txt
similarity index 100%
rename from src/drivers/boards/px4cannode-v1/CMakeLists.txt
rename to platforms/nuttx/src/drivers/boards/px4cannode-v1/CMakeLists.txt
diff --git a/src/drivers/boards/px4cannode-v1/bootloader/CMakeLists.txt b/platforms/nuttx/src/drivers/boards/px4cannode-v1/bootloader/CMakeLists.txt
similarity index 94%
rename from src/drivers/boards/px4cannode-v1/bootloader/CMakeLists.txt
rename to platforms/nuttx/src/drivers/boards/px4cannode-v1/bootloader/CMakeLists.txt
index 09a101560c2e..934a9834876b 100644
--- a/src/drivers/boards/px4cannode-v1/bootloader/CMakeLists.txt
+++ b/platforms/nuttx/src/drivers/boards/px4cannode-v1/bootloader/CMakeLists.txt
@@ -39,7 +39,8 @@ add_definitions(
)
include_directories(${px4_bootloader_base}include)
-include_directories(${px4_module_base}systemlib)
+include_directories(${PX4_SOURCE_DIR}/platforms/nuttx/src/modules/systemlib)
+include_directories(${PX4_SOURCE_DIR}/src/modules/systemlib)
include_directories(.)
px4_add_module(
diff --git a/src/drivers/boards/px4cannode-v1/bootloader/boot.c b/platforms/nuttx/src/drivers/boards/px4cannode-v1/bootloader/boot.c
similarity index 100%
rename from src/drivers/boards/px4cannode-v1/bootloader/boot.c
rename to platforms/nuttx/src/drivers/boards/px4cannode-v1/bootloader/boot.c
diff --git a/src/drivers/boards/px4cannode-v1/bootloader/boot_config.h b/platforms/nuttx/src/drivers/boards/px4cannode-v1/bootloader/boot_config.h
similarity index 99%
rename from src/drivers/boards/px4cannode-v1/bootloader/boot_config.h
rename to platforms/nuttx/src/drivers/boards/px4cannode-v1/bootloader/boot_config.h
index c5a07e925a5c..8925ab497bfa 100644
--- a/src/drivers/boards/px4cannode-v1/bootloader/boot_config.h
+++ b/platforms/nuttx/src/drivers/boards/px4cannode-v1/bootloader/boot_config.h
@@ -51,7 +51,7 @@
* todo:make this be pulled in from a targed's build
* files in nuttx*/
-#include "../board_config.h"
+#include "board_config.h"
#include "uavcan.h"
#include
#include
diff --git a/src/drivers/boards/px4cannode-v1/bootloader/led.c b/platforms/nuttx/src/drivers/boards/px4cannode-v1/bootloader/led.c
similarity index 100%
rename from src/drivers/boards/px4cannode-v1/bootloader/led.c
rename to platforms/nuttx/src/drivers/boards/px4cannode-v1/bootloader/led.c
diff --git a/src/drivers/boards/px4cannode-v1/bootloader/led.h b/platforms/nuttx/src/drivers/boards/px4cannode-v1/bootloader/led.h
similarity index 100%
rename from src/drivers/boards/px4cannode-v1/bootloader/led.h
rename to platforms/nuttx/src/drivers/boards/px4cannode-v1/bootloader/led.h
diff --git a/src/drivers/boards/px4cannode-v1/px4cannode_buttons.c b/platforms/nuttx/src/drivers/boards/px4cannode-v1/px4cannode_buttons.c
similarity index 100%
rename from src/drivers/boards/px4cannode-v1/px4cannode_buttons.c
rename to platforms/nuttx/src/drivers/boards/px4cannode-v1/px4cannode_buttons.c
diff --git a/src/drivers/boards/px4cannode-v1/px4cannode_can.c b/platforms/nuttx/src/drivers/boards/px4cannode-v1/px4cannode_can.c
similarity index 100%
rename from src/drivers/boards/px4cannode-v1/px4cannode_can.c
rename to platforms/nuttx/src/drivers/boards/px4cannode-v1/px4cannode_can.c
diff --git a/src/drivers/boards/px4cannode-v1/px4cannode_init.c b/platforms/nuttx/src/drivers/boards/px4cannode-v1/px4cannode_init.c
similarity index 100%
rename from src/drivers/boards/px4cannode-v1/px4cannode_init.c
rename to platforms/nuttx/src/drivers/boards/px4cannode-v1/px4cannode_init.c
diff --git a/src/drivers/boards/px4cannode-v1/px4cannode_led.c b/platforms/nuttx/src/drivers/boards/px4cannode-v1/px4cannode_led.c
similarity index 100%
rename from src/drivers/boards/px4cannode-v1/px4cannode_led.c
rename to platforms/nuttx/src/drivers/boards/px4cannode-v1/px4cannode_led.c
diff --git a/src/drivers/boards/px4cannode-v1/px4cannode_spi.c b/platforms/nuttx/src/drivers/boards/px4cannode-v1/px4cannode_spi.c
similarity index 100%
rename from src/drivers/boards/px4cannode-v1/px4cannode_spi.c
rename to platforms/nuttx/src/drivers/boards/px4cannode-v1/px4cannode_spi.c
diff --git a/src/drivers/boards/px4esc-v1/CMakeLists.txt b/platforms/nuttx/src/drivers/boards/px4esc-v1/CMakeLists.txt
similarity index 100%
rename from src/drivers/boards/px4esc-v1/CMakeLists.txt
rename to platforms/nuttx/src/drivers/boards/px4esc-v1/CMakeLists.txt
diff --git a/src/drivers/boards/px4esc-v1/bootloader/CMakeLists.txt b/platforms/nuttx/src/drivers/boards/px4esc-v1/bootloader/CMakeLists.txt
similarity index 94%
rename from src/drivers/boards/px4esc-v1/bootloader/CMakeLists.txt
rename to platforms/nuttx/src/drivers/boards/px4esc-v1/bootloader/CMakeLists.txt
index 06f6d89e4b3f..33263db564b8 100644
--- a/src/drivers/boards/px4esc-v1/bootloader/CMakeLists.txt
+++ b/platforms/nuttx/src/drivers/boards/px4esc-v1/bootloader/CMakeLists.txt
@@ -39,7 +39,8 @@ add_definitions(
)
include_directories(${px4_bootloader_base}include)
-include_directories(${px4_module_base}systemlib)
+include_directories(${PX4_SOURCE_DIR}/platforms/nuttx/src/modules/systemlib)
+include_directories(${PX4_SOURCE_DIR}/src/modules/systemlib)
include_directories(.)
px4_add_module(
diff --git a/src/drivers/boards/px4esc-v1/bootloader/boot.c b/platforms/nuttx/src/drivers/boards/px4esc-v1/bootloader/boot.c
similarity index 100%
rename from src/drivers/boards/px4esc-v1/bootloader/boot.c
rename to platforms/nuttx/src/drivers/boards/px4esc-v1/bootloader/boot.c
diff --git a/src/drivers/boards/px4esc-v1/bootloader/boot_config.h b/platforms/nuttx/src/drivers/boards/px4esc-v1/bootloader/boot_config.h
similarity index 99%
rename from src/drivers/boards/px4esc-v1/bootloader/boot_config.h
rename to platforms/nuttx/src/drivers/boards/px4esc-v1/bootloader/boot_config.h
index eb36b19c69c1..18251b74f090 100644
--- a/src/drivers/boards/px4esc-v1/bootloader/boot_config.h
+++ b/platforms/nuttx/src/drivers/boards/px4esc-v1/bootloader/boot_config.h
@@ -51,7 +51,7 @@
* todo:make this be pulled in from a targed's build
* files in nuttx*/
-#include "../board_config.h"
+#include "board_config.h"
#include "uavcan.h"
#include
#include
diff --git a/src/drivers/boards/px4esc-v1/bootloader/led.c b/platforms/nuttx/src/drivers/boards/px4esc-v1/bootloader/led.c
similarity index 100%
rename from src/drivers/boards/px4esc-v1/bootloader/led.c
rename to platforms/nuttx/src/drivers/boards/px4esc-v1/bootloader/led.c
diff --git a/src/drivers/boards/px4esc-v1/bootloader/led.h b/platforms/nuttx/src/drivers/boards/px4esc-v1/bootloader/led.h
similarity index 100%
rename from src/drivers/boards/px4esc-v1/bootloader/led.h
rename to platforms/nuttx/src/drivers/boards/px4esc-v1/bootloader/led.h
diff --git a/src/drivers/boards/px4esc-v1/px4esc_init.c b/platforms/nuttx/src/drivers/boards/px4esc-v1/px4esc_init.c
similarity index 100%
rename from src/drivers/boards/px4esc-v1/px4esc_init.c
rename to platforms/nuttx/src/drivers/boards/px4esc-v1/px4esc_init.c
diff --git a/src/drivers/boards/px4esc-v1/px4esc_led.c b/platforms/nuttx/src/drivers/boards/px4esc-v1/px4esc_led.c
similarity index 100%
rename from src/drivers/boards/px4esc-v1/px4esc_led.c
rename to platforms/nuttx/src/drivers/boards/px4esc-v1/px4esc_led.c
diff --git a/src/drivers/boards/px4esc-v1/px4esc_usb.c b/platforms/nuttx/src/drivers/boards/px4esc-v1/px4esc_usb.c
similarity index 100%
rename from src/drivers/boards/px4esc-v1/px4esc_usb.c
rename to platforms/nuttx/src/drivers/boards/px4esc-v1/px4esc_usb.c
diff --git a/src/drivers/boards/px4flow-v2/CMakeLists.txt b/platforms/nuttx/src/drivers/boards/px4flow-v2/CMakeLists.txt
similarity index 100%
rename from src/drivers/boards/px4flow-v2/CMakeLists.txt
rename to platforms/nuttx/src/drivers/boards/px4flow-v2/CMakeLists.txt
diff --git a/src/drivers/boards/px4flow-v2/bootloader/CMakeLists.txt b/platforms/nuttx/src/drivers/boards/px4flow-v2/bootloader/CMakeLists.txt
similarity index 94%
rename from src/drivers/boards/px4flow-v2/bootloader/CMakeLists.txt
rename to platforms/nuttx/src/drivers/boards/px4flow-v2/bootloader/CMakeLists.txt
index de789e83fcaf..ae02ec5ebd15 100644
--- a/src/drivers/boards/px4flow-v2/bootloader/CMakeLists.txt
+++ b/platforms/nuttx/src/drivers/boards/px4flow-v2/bootloader/CMakeLists.txt
@@ -39,7 +39,8 @@ add_definitions(
)
include_directories(${px4_bootloader_base}include)
-include_directories(${px4_module_base}systemlib)
+include_directories(${PX4_SOURCE_DIR}/platforms/nuttx/src/modules/systemlib)
+include_directories(${PX4_SOURCE_DIR}/src/modules/systemlib)
include_directories(.)
px4_add_module(
diff --git a/src/drivers/boards/px4flow-v2/bootloader/boot.c b/platforms/nuttx/src/drivers/boards/px4flow-v2/bootloader/boot.c
similarity index 100%
rename from src/drivers/boards/px4flow-v2/bootloader/boot.c
rename to platforms/nuttx/src/drivers/boards/px4flow-v2/bootloader/boot.c
diff --git a/src/drivers/boards/px4flow-v2/bootloader/boot_config.h b/platforms/nuttx/src/drivers/boards/px4flow-v2/bootloader/boot_config.h
similarity index 99%
rename from src/drivers/boards/px4flow-v2/bootloader/boot_config.h
rename to platforms/nuttx/src/drivers/boards/px4flow-v2/bootloader/boot_config.h
index cdbbab349517..11a7dccc260b 100644
--- a/src/drivers/boards/px4flow-v2/bootloader/boot_config.h
+++ b/platforms/nuttx/src/drivers/boards/px4flow-v2/bootloader/boot_config.h
@@ -51,7 +51,7 @@
* todo:make this be pulled in from a targed's build
* files in nuttx*/
-#include "../board_config.h"
+#include "board_config.h"
#include "uavcan.h"
#include
#include
diff --git a/src/drivers/boards/px4flow-v2/bootloader/led.c b/platforms/nuttx/src/drivers/boards/px4flow-v2/bootloader/led.c
similarity index 100%
rename from src/drivers/boards/px4flow-v2/bootloader/led.c
rename to platforms/nuttx/src/drivers/boards/px4flow-v2/bootloader/led.c
diff --git a/src/drivers/boards/px4flow-v2/bootloader/led.h b/platforms/nuttx/src/drivers/boards/px4flow-v2/bootloader/led.h
similarity index 100%
rename from src/drivers/boards/px4flow-v2/bootloader/led.h
rename to platforms/nuttx/src/drivers/boards/px4flow-v2/bootloader/led.h
diff --git a/src/drivers/boards/px4flow-v2/px4flow_can.c b/platforms/nuttx/src/drivers/boards/px4flow-v2/px4flow_can.c
similarity index 100%
rename from src/drivers/boards/px4flow-v2/px4flow_can.c
rename to platforms/nuttx/src/drivers/boards/px4flow-v2/px4flow_can.c
diff --git a/src/drivers/boards/px4flow-v2/px4flow_init.c b/platforms/nuttx/src/drivers/boards/px4flow-v2/px4flow_init.c
similarity index 100%
rename from src/drivers/boards/px4flow-v2/px4flow_init.c
rename to platforms/nuttx/src/drivers/boards/px4flow-v2/px4flow_init.c
diff --git a/src/drivers/boards/px4flow-v2/px4flow_led.c b/platforms/nuttx/src/drivers/boards/px4flow-v2/px4flow_led.c
similarity index 100%
rename from src/drivers/boards/px4flow-v2/px4flow_led.c
rename to platforms/nuttx/src/drivers/boards/px4flow-v2/px4flow_led.c
diff --git a/src/drivers/boards/px4fmu-v1/CMakeLists.txt b/platforms/nuttx/src/drivers/boards/px4fmu-v1/CMakeLists.txt
similarity index 100%
rename from src/drivers/boards/px4fmu-v1/CMakeLists.txt
rename to platforms/nuttx/src/drivers/boards/px4fmu-v1/CMakeLists.txt
diff --git a/src/drivers/boards/px4fmu-v1/px4fmu_can.c b/platforms/nuttx/src/drivers/boards/px4fmu-v1/px4fmu_can.c
similarity index 100%
rename from src/drivers/boards/px4fmu-v1/px4fmu_can.c
rename to platforms/nuttx/src/drivers/boards/px4fmu-v1/px4fmu_can.c
diff --git a/src/drivers/boards/px4fmu-v1/px4fmu_init.c b/platforms/nuttx/src/drivers/boards/px4fmu-v1/px4fmu_init.c
similarity index 100%
rename from src/drivers/boards/px4fmu-v1/px4fmu_init.c
rename to platforms/nuttx/src/drivers/boards/px4fmu-v1/px4fmu_init.c
diff --git a/src/drivers/boards/px4fmu-v1/px4fmu_led.c b/platforms/nuttx/src/drivers/boards/px4fmu-v1/px4fmu_led.c
similarity index 100%
rename from src/drivers/boards/px4fmu-v1/px4fmu_led.c
rename to platforms/nuttx/src/drivers/boards/px4fmu-v1/px4fmu_led.c
diff --git a/src/drivers/boards/px4fmu-v1/px4fmu_spi.c b/platforms/nuttx/src/drivers/boards/px4fmu-v1/px4fmu_spi.c
similarity index 100%
rename from src/drivers/boards/px4fmu-v1/px4fmu_spi.c
rename to platforms/nuttx/src/drivers/boards/px4fmu-v1/px4fmu_spi.c
diff --git a/src/drivers/boards/px4fmu-v1/px4fmu_timer_config.c b/platforms/nuttx/src/drivers/boards/px4fmu-v1/px4fmu_timer_config.c
similarity index 100%
rename from src/drivers/boards/px4fmu-v1/px4fmu_timer_config.c
rename to platforms/nuttx/src/drivers/boards/px4fmu-v1/px4fmu_timer_config.c
diff --git a/src/drivers/boards/px4fmu-v1/px4fmu_usb.c b/platforms/nuttx/src/drivers/boards/px4fmu-v1/px4fmu_usb.c
similarity index 100%
rename from src/drivers/boards/px4fmu-v1/px4fmu_usb.c
rename to platforms/nuttx/src/drivers/boards/px4fmu-v1/px4fmu_usb.c
diff --git a/src/drivers/boards/px4fmu-v2/CMakeLists.txt b/platforms/nuttx/src/drivers/boards/px4fmu-v2/CMakeLists.txt
similarity index 100%
rename from src/drivers/boards/px4fmu-v2/CMakeLists.txt
rename to platforms/nuttx/src/drivers/boards/px4fmu-v2/CMakeLists.txt
diff --git a/src/drivers/boards/px4fmu-v2/px4fmu2_init.c b/platforms/nuttx/src/drivers/boards/px4fmu-v2/px4fmu2_init.c
similarity index 100%
rename from src/drivers/boards/px4fmu-v2/px4fmu2_init.c
rename to platforms/nuttx/src/drivers/boards/px4fmu-v2/px4fmu2_init.c
diff --git a/src/drivers/boards/px4fmu-v2/px4fmu2_led.c b/platforms/nuttx/src/drivers/boards/px4fmu-v2/px4fmu2_led.c
similarity index 100%
rename from src/drivers/boards/px4fmu-v2/px4fmu2_led.c
rename to platforms/nuttx/src/drivers/boards/px4fmu-v2/px4fmu2_led.c
diff --git a/src/drivers/boards/px4fmu-v2/px4fmu_can.c b/platforms/nuttx/src/drivers/boards/px4fmu-v2/px4fmu_can.c
similarity index 100%
rename from src/drivers/boards/px4fmu-v2/px4fmu_can.c
rename to platforms/nuttx/src/drivers/boards/px4fmu-v2/px4fmu_can.c
diff --git a/src/drivers/boards/px4fmu-v2/px4fmu_spi.c b/platforms/nuttx/src/drivers/boards/px4fmu-v2/px4fmu_spi.c
similarity index 100%
rename from src/drivers/boards/px4fmu-v2/px4fmu_spi.c
rename to platforms/nuttx/src/drivers/boards/px4fmu-v2/px4fmu_spi.c
diff --git a/src/drivers/boards/px4fmu-v2/px4fmu_timer_config.c b/platforms/nuttx/src/drivers/boards/px4fmu-v2/px4fmu_timer_config.c
similarity index 100%
rename from src/drivers/boards/px4fmu-v2/px4fmu_timer_config.c
rename to platforms/nuttx/src/drivers/boards/px4fmu-v2/px4fmu_timer_config.c
diff --git a/src/drivers/boards/px4fmu-v2/px4fmu_usb.c b/platforms/nuttx/src/drivers/boards/px4fmu-v2/px4fmu_usb.c
similarity index 100%
rename from src/drivers/boards/px4fmu-v2/px4fmu_usb.c
rename to platforms/nuttx/src/drivers/boards/px4fmu-v2/px4fmu_usb.c
diff --git a/src/drivers/boards/px4fmu-v4/CMakeLists.txt b/platforms/nuttx/src/drivers/boards/px4fmu-v4/CMakeLists.txt
similarity index 100%
rename from src/drivers/boards/px4fmu-v4/CMakeLists.txt
rename to platforms/nuttx/src/drivers/boards/px4fmu-v4/CMakeLists.txt
diff --git a/src/drivers/boards/px4fmu-v4/px4fmu_can.c b/platforms/nuttx/src/drivers/boards/px4fmu-v4/px4fmu_can.c
similarity index 100%
rename from src/drivers/boards/px4fmu-v4/px4fmu_can.c
rename to platforms/nuttx/src/drivers/boards/px4fmu-v4/px4fmu_can.c
diff --git a/src/drivers/boards/px4fmu-v4/px4fmu_init.c b/platforms/nuttx/src/drivers/boards/px4fmu-v4/px4fmu_init.c
similarity index 100%
rename from src/drivers/boards/px4fmu-v4/px4fmu_init.c
rename to platforms/nuttx/src/drivers/boards/px4fmu-v4/px4fmu_init.c
diff --git a/src/drivers/boards/px4fmu-v4/px4fmu_led.c b/platforms/nuttx/src/drivers/boards/px4fmu-v4/px4fmu_led.c
similarity index 100%
rename from src/drivers/boards/px4fmu-v4/px4fmu_led.c
rename to platforms/nuttx/src/drivers/boards/px4fmu-v4/px4fmu_led.c
diff --git a/src/drivers/boards/px4fmu-v4/px4fmu_spi.c b/platforms/nuttx/src/drivers/boards/px4fmu-v4/px4fmu_spi.c
similarity index 100%
rename from src/drivers/boards/px4fmu-v4/px4fmu_spi.c
rename to platforms/nuttx/src/drivers/boards/px4fmu-v4/px4fmu_spi.c
diff --git a/src/drivers/boards/px4fmu-v4/px4fmu_timer_config.c b/platforms/nuttx/src/drivers/boards/px4fmu-v4/px4fmu_timer_config.c
similarity index 100%
rename from src/drivers/boards/px4fmu-v4/px4fmu_timer_config.c
rename to platforms/nuttx/src/drivers/boards/px4fmu-v4/px4fmu_timer_config.c
diff --git a/src/drivers/boards/px4fmu-v4/px4fmu_usb.c b/platforms/nuttx/src/drivers/boards/px4fmu-v4/px4fmu_usb.c
similarity index 100%
rename from src/drivers/boards/px4fmu-v4/px4fmu_usb.c
rename to platforms/nuttx/src/drivers/boards/px4fmu-v4/px4fmu_usb.c
diff --git a/src/drivers/boards/px4fmu-v4pro/CMakeLists.txt b/platforms/nuttx/src/drivers/boards/px4fmu-v4pro/CMakeLists.txt
similarity index 100%
rename from src/drivers/boards/px4fmu-v4pro/CMakeLists.txt
rename to platforms/nuttx/src/drivers/boards/px4fmu-v4pro/CMakeLists.txt
diff --git a/src/drivers/boards/px4fmu-v4pro/px4fmu_can.c b/platforms/nuttx/src/drivers/boards/px4fmu-v4pro/px4fmu_can.c
similarity index 100%
rename from src/drivers/boards/px4fmu-v4pro/px4fmu_can.c
rename to platforms/nuttx/src/drivers/boards/px4fmu-v4pro/px4fmu_can.c
diff --git a/src/drivers/boards/px4fmu-v4pro/px4fmu_init.c b/platforms/nuttx/src/drivers/boards/px4fmu-v4pro/px4fmu_init.c
similarity index 100%
rename from src/drivers/boards/px4fmu-v4pro/px4fmu_init.c
rename to platforms/nuttx/src/drivers/boards/px4fmu-v4pro/px4fmu_init.c
diff --git a/src/drivers/boards/px4fmu-v4pro/px4fmu_led.c b/platforms/nuttx/src/drivers/boards/px4fmu-v4pro/px4fmu_led.c
similarity index 100%
rename from src/drivers/boards/px4fmu-v4pro/px4fmu_led.c
rename to platforms/nuttx/src/drivers/boards/px4fmu-v4pro/px4fmu_led.c
diff --git a/src/drivers/boards/px4fmu-v4pro/px4fmu_spi.c b/platforms/nuttx/src/drivers/boards/px4fmu-v4pro/px4fmu_spi.c
similarity index 100%
rename from src/drivers/boards/px4fmu-v4pro/px4fmu_spi.c
rename to platforms/nuttx/src/drivers/boards/px4fmu-v4pro/px4fmu_spi.c
diff --git a/src/drivers/boards/px4fmu-v4pro/px4fmu_timer_config.c b/platforms/nuttx/src/drivers/boards/px4fmu-v4pro/px4fmu_timer_config.c
similarity index 100%
rename from src/drivers/boards/px4fmu-v4pro/px4fmu_timer_config.c
rename to platforms/nuttx/src/drivers/boards/px4fmu-v4pro/px4fmu_timer_config.c
diff --git a/src/drivers/boards/px4fmu-v4pro/px4fmu_usb.c b/platforms/nuttx/src/drivers/boards/px4fmu-v4pro/px4fmu_usb.c
similarity index 100%
rename from src/drivers/boards/px4fmu-v4pro/px4fmu_usb.c
rename to platforms/nuttx/src/drivers/boards/px4fmu-v4pro/px4fmu_usb.c
diff --git a/src/drivers/boards/px4fmu-v5/CMakeLists.txt b/platforms/nuttx/src/drivers/boards/px4fmu-v5/CMakeLists.txt
similarity index 100%
rename from src/drivers/boards/px4fmu-v5/CMakeLists.txt
rename to platforms/nuttx/src/drivers/boards/px4fmu-v5/CMakeLists.txt
diff --git a/src/drivers/boards/px4fmu-v5/px4fmu_can.c b/platforms/nuttx/src/drivers/boards/px4fmu-v5/px4fmu_can.c
similarity index 100%
rename from src/drivers/boards/px4fmu-v5/px4fmu_can.c
rename to platforms/nuttx/src/drivers/boards/px4fmu-v5/px4fmu_can.c
diff --git a/src/drivers/boards/px4fmu-v5/px4fmu_init.c b/platforms/nuttx/src/drivers/boards/px4fmu-v5/px4fmu_init.c
similarity index 100%
rename from src/drivers/boards/px4fmu-v5/px4fmu_init.c
rename to platforms/nuttx/src/drivers/boards/px4fmu-v5/px4fmu_init.c
diff --git a/src/drivers/boards/px4fmu-v5/px4fmu_led.c b/platforms/nuttx/src/drivers/boards/px4fmu-v5/px4fmu_led.c
similarity index 100%
rename from src/drivers/boards/px4fmu-v5/px4fmu_led.c
rename to platforms/nuttx/src/drivers/boards/px4fmu-v5/px4fmu_led.c
diff --git a/src/drivers/boards/px4fmu-v5/px4fmu_sdio.c b/platforms/nuttx/src/drivers/boards/px4fmu-v5/px4fmu_sdio.c
similarity index 100%
rename from src/drivers/boards/px4fmu-v5/px4fmu_sdio.c
rename to platforms/nuttx/src/drivers/boards/px4fmu-v5/px4fmu_sdio.c
diff --git a/src/drivers/boards/px4fmu-v5/px4fmu_spi.c b/platforms/nuttx/src/drivers/boards/px4fmu-v5/px4fmu_spi.c
similarity index 100%
rename from src/drivers/boards/px4fmu-v5/px4fmu_spi.c
rename to platforms/nuttx/src/drivers/boards/px4fmu-v5/px4fmu_spi.c
diff --git a/src/drivers/boards/px4fmu-v5/px4fmu_timer_config.c b/platforms/nuttx/src/drivers/boards/px4fmu-v5/px4fmu_timer_config.c
similarity index 100%
rename from src/drivers/boards/px4fmu-v5/px4fmu_timer_config.c
rename to platforms/nuttx/src/drivers/boards/px4fmu-v5/px4fmu_timer_config.c
diff --git a/src/drivers/boards/px4fmu-v5/px4fmu_usb.c b/platforms/nuttx/src/drivers/boards/px4fmu-v5/px4fmu_usb.c
similarity index 100%
rename from src/drivers/boards/px4fmu-v5/px4fmu_usb.c
rename to platforms/nuttx/src/drivers/boards/px4fmu-v5/px4fmu_usb.c
diff --git a/src/drivers/boards/px4io-v1/CMakeLists.txt b/platforms/nuttx/src/drivers/boards/px4io-v1/CMakeLists.txt
similarity index 100%
rename from src/drivers/boards/px4io-v1/CMakeLists.txt
rename to platforms/nuttx/src/drivers/boards/px4io-v1/CMakeLists.txt
diff --git a/src/drivers/boards/px4io-v1/board_config.h b/platforms/nuttx/src/drivers/boards/px4io-v1/board_config.h
similarity index 100%
rename from src/drivers/boards/px4io-v1/board_config.h
rename to platforms/nuttx/src/drivers/boards/px4io-v1/board_config.h
diff --git a/src/drivers/boards/px4io-v1/px4io_init.c b/platforms/nuttx/src/drivers/boards/px4io-v1/px4io_init.c
similarity index 100%
rename from src/drivers/boards/px4io-v1/px4io_init.c
rename to platforms/nuttx/src/drivers/boards/px4io-v1/px4io_init.c
diff --git a/src/drivers/boards/px4io-v1/px4io_timer_config.c b/platforms/nuttx/src/drivers/boards/px4io-v1/px4io_timer_config.c
similarity index 100%
rename from src/drivers/boards/px4io-v1/px4io_timer_config.c
rename to platforms/nuttx/src/drivers/boards/px4io-v1/px4io_timer_config.c
diff --git a/src/drivers/boards/px4io-v2/CMakeLists.txt b/platforms/nuttx/src/drivers/boards/px4io-v2/CMakeLists.txt
similarity index 100%
rename from src/drivers/boards/px4io-v2/CMakeLists.txt
rename to platforms/nuttx/src/drivers/boards/px4io-v2/CMakeLists.txt
diff --git a/src/drivers/boards/px4io-v2/board_config.h b/platforms/nuttx/src/drivers/boards/px4io-v2/board_config.h
similarity index 100%
rename from src/drivers/boards/px4io-v2/board_config.h
rename to platforms/nuttx/src/drivers/boards/px4io-v2/board_config.h
diff --git a/src/drivers/boards/px4io-v2/px4io_init.c b/platforms/nuttx/src/drivers/boards/px4io-v2/px4io_init.c
similarity index 100%
rename from src/drivers/boards/px4io-v2/px4io_init.c
rename to platforms/nuttx/src/drivers/boards/px4io-v2/px4io_init.c
diff --git a/src/drivers/boards/px4io-v2/px4io_timer_config.c b/platforms/nuttx/src/drivers/boards/px4io-v2/px4io_timer_config.c
similarity index 100%
rename from src/drivers/boards/px4io-v2/px4io_timer_config.c
rename to platforms/nuttx/src/drivers/boards/px4io-v2/px4io_timer_config.c
diff --git a/src/drivers/boards/px4nucleoF767ZI-v1/CMakeLists.txt b/platforms/nuttx/src/drivers/boards/px4nucleoF767ZI-v1/CMakeLists.txt
similarity index 100%
rename from src/drivers/boards/px4nucleoF767ZI-v1/CMakeLists.txt
rename to platforms/nuttx/src/drivers/boards/px4nucleoF767ZI-v1/CMakeLists.txt
diff --git a/src/drivers/boards/px4nucleoF767ZI-v1/px4nucleo_can.c b/platforms/nuttx/src/drivers/boards/px4nucleoF767ZI-v1/px4nucleo_can.c
similarity index 100%
rename from src/drivers/boards/px4nucleoF767ZI-v1/px4nucleo_can.c
rename to platforms/nuttx/src/drivers/boards/px4nucleoF767ZI-v1/px4nucleo_can.c
diff --git a/src/drivers/boards/px4nucleoF767ZI-v1/px4nucleo_init.c b/platforms/nuttx/src/drivers/boards/px4nucleoF767ZI-v1/px4nucleo_init.c
similarity index 100%
rename from src/drivers/boards/px4nucleoF767ZI-v1/px4nucleo_init.c
rename to platforms/nuttx/src/drivers/boards/px4nucleoF767ZI-v1/px4nucleo_init.c
diff --git a/src/drivers/boards/px4nucleoF767ZI-v1/px4nucleo_led.c b/platforms/nuttx/src/drivers/boards/px4nucleoF767ZI-v1/px4nucleo_led.c
similarity index 100%
rename from src/drivers/boards/px4nucleoF767ZI-v1/px4nucleo_led.c
rename to platforms/nuttx/src/drivers/boards/px4nucleoF767ZI-v1/px4nucleo_led.c
diff --git a/src/drivers/boards/px4nucleoF767ZI-v1/px4nucleo_sdio.c b/platforms/nuttx/src/drivers/boards/px4nucleoF767ZI-v1/px4nucleo_sdio.c
similarity index 100%
rename from src/drivers/boards/px4nucleoF767ZI-v1/px4nucleo_sdio.c
rename to platforms/nuttx/src/drivers/boards/px4nucleoF767ZI-v1/px4nucleo_sdio.c
diff --git a/src/drivers/boards/px4nucleoF767ZI-v1/px4nucleo_spi.c b/platforms/nuttx/src/drivers/boards/px4nucleoF767ZI-v1/px4nucleo_spi.c
similarity index 100%
rename from src/drivers/boards/px4nucleoF767ZI-v1/px4nucleo_spi.c
rename to platforms/nuttx/src/drivers/boards/px4nucleoF767ZI-v1/px4nucleo_spi.c
diff --git a/src/drivers/boards/px4nucleoF767ZI-v1/px4nucleo_timer_config.c b/platforms/nuttx/src/drivers/boards/px4nucleoF767ZI-v1/px4nucleo_timer_config.c
similarity index 100%
rename from src/drivers/boards/px4nucleoF767ZI-v1/px4nucleo_timer_config.c
rename to platforms/nuttx/src/drivers/boards/px4nucleoF767ZI-v1/px4nucleo_timer_config.c
diff --git a/src/drivers/boards/px4nucleoF767ZI-v1/px4nucleo_usb.c b/platforms/nuttx/src/drivers/boards/px4nucleoF767ZI-v1/px4nucleo_usb.c
similarity index 100%
rename from src/drivers/boards/px4nucleoF767ZI-v1/px4nucleo_usb.c
rename to platforms/nuttx/src/drivers/boards/px4nucleoF767ZI-v1/px4nucleo_usb.c
diff --git a/src/drivers/boards/s2740vc-v1/CMakeLists.txt b/platforms/nuttx/src/drivers/boards/s2740vc-v1/CMakeLists.txt
similarity index 100%
rename from src/drivers/boards/s2740vc-v1/CMakeLists.txt
rename to platforms/nuttx/src/drivers/boards/s2740vc-v1/CMakeLists.txt
diff --git a/src/drivers/boards/s2740vc-v1/bootloader/CMakeLists.txt b/platforms/nuttx/src/drivers/boards/s2740vc-v1/bootloader/CMakeLists.txt
similarity index 94%
rename from src/drivers/boards/s2740vc-v1/bootloader/CMakeLists.txt
rename to platforms/nuttx/src/drivers/boards/s2740vc-v1/bootloader/CMakeLists.txt
index a6a15bf9b30a..e3ce3757820a 100644
--- a/src/drivers/boards/s2740vc-v1/bootloader/CMakeLists.txt
+++ b/platforms/nuttx/src/drivers/boards/s2740vc-v1/bootloader/CMakeLists.txt
@@ -39,7 +39,8 @@ add_definitions(
)
include_directories(${px4_bootloader_base}include)
-include_directories(${px4_module_base}systemlib)
+include_directories(${PX4_SOURCE_DIR}/platforms/nuttx/src/modules/systemlib)
+include_directories(${PX4_SOURCE_DIR}/src/modules/systemlib)
include_directories(.)
px4_add_module(
diff --git a/src/drivers/boards/s2740vc-v1/bootloader/boot.c b/platforms/nuttx/src/drivers/boards/s2740vc-v1/bootloader/boot.c
similarity index 100%
rename from src/drivers/boards/s2740vc-v1/bootloader/boot.c
rename to platforms/nuttx/src/drivers/boards/s2740vc-v1/bootloader/boot.c
diff --git a/src/drivers/boards/s2740vc-v1/bootloader/boot_config.h b/platforms/nuttx/src/drivers/boards/s2740vc-v1/bootloader/boot_config.h
similarity index 99%
rename from src/drivers/boards/s2740vc-v1/bootloader/boot_config.h
rename to platforms/nuttx/src/drivers/boards/s2740vc-v1/bootloader/boot_config.h
index f2ca3d20d6fb..7c9997ab520c 100644
--- a/src/drivers/boards/s2740vc-v1/bootloader/boot_config.h
+++ b/platforms/nuttx/src/drivers/boards/s2740vc-v1/bootloader/boot_config.h
@@ -52,7 +52,7 @@
* todo:make this be pulled in from a targed's build
* files in nuttx*/
-#include "../board_config.h"
+#include "board_config.h"
#include "uavcan.h"
#include
#include
diff --git a/src/drivers/boards/s2740vc-v1/s2740vc_can.c b/platforms/nuttx/src/drivers/boards/s2740vc-v1/s2740vc_can.c
similarity index 100%
rename from src/drivers/boards/s2740vc-v1/s2740vc_can.c
rename to platforms/nuttx/src/drivers/boards/s2740vc-v1/s2740vc_can.c
diff --git a/src/drivers/boards/s2740vc-v1/s2740vc_init.c b/platforms/nuttx/src/drivers/boards/s2740vc-v1/s2740vc_init.c
similarity index 100%
rename from src/drivers/boards/s2740vc-v1/s2740vc_init.c
rename to platforms/nuttx/src/drivers/boards/s2740vc-v1/s2740vc_init.c
diff --git a/src/drivers/boards/tap-v1/CMakeLists.txt b/platforms/nuttx/src/drivers/boards/tap-v1/CMakeLists.txt
similarity index 100%
rename from src/drivers/boards/tap-v1/CMakeLists.txt
rename to platforms/nuttx/src/drivers/boards/tap-v1/CMakeLists.txt
diff --git a/src/drivers/boards/tap-v1/tap_init.c b/platforms/nuttx/src/drivers/boards/tap-v1/tap_init.c
similarity index 100%
rename from src/drivers/boards/tap-v1/tap_init.c
rename to platforms/nuttx/src/drivers/boards/tap-v1/tap_init.c
diff --git a/src/drivers/boards/tap-v1/tap_led.c b/platforms/nuttx/src/drivers/boards/tap-v1/tap_led.c
similarity index 100%
rename from src/drivers/boards/tap-v1/tap_led.c
rename to platforms/nuttx/src/drivers/boards/tap-v1/tap_led.c
diff --git a/src/drivers/boards/tap-v1/tap_pwr.c b/platforms/nuttx/src/drivers/boards/tap-v1/tap_pwr.c
similarity index 100%
rename from src/drivers/boards/tap-v1/tap_pwr.c
rename to platforms/nuttx/src/drivers/boards/tap-v1/tap_pwr.c
diff --git a/src/drivers/boards/tap-v1/tap_sdio.c b/platforms/nuttx/src/drivers/boards/tap-v1/tap_sdio.c
similarity index 100%
rename from src/drivers/boards/tap-v1/tap_sdio.c
rename to platforms/nuttx/src/drivers/boards/tap-v1/tap_sdio.c
diff --git a/src/drivers/boards/tap-v1/tap_spi.c b/platforms/nuttx/src/drivers/boards/tap-v1/tap_spi.c
similarity index 100%
rename from src/drivers/boards/tap-v1/tap_spi.c
rename to platforms/nuttx/src/drivers/boards/tap-v1/tap_spi.c
diff --git a/src/drivers/boards/tap-v1/tap_timer_config.c b/platforms/nuttx/src/drivers/boards/tap-v1/tap_timer_config.c
similarity index 100%
rename from src/drivers/boards/tap-v1/tap_timer_config.c
rename to platforms/nuttx/src/drivers/boards/tap-v1/tap_timer_config.c
diff --git a/src/drivers/boards/tap-v1/tap_usb.c b/platforms/nuttx/src/drivers/boards/tap-v1/tap_usb.c
similarity index 100%
rename from src/drivers/boards/tap-v1/tap_usb.c
rename to platforms/nuttx/src/drivers/boards/tap-v1/tap_usb.c
diff --git a/src/drivers/boards/zubaxgnss-v1/CMakeLists.txt b/platforms/nuttx/src/drivers/boards/zubaxgnss-v1/CMakeLists.txt
similarity index 100%
rename from src/drivers/boards/zubaxgnss-v1/CMakeLists.txt
rename to platforms/nuttx/src/drivers/boards/zubaxgnss-v1/CMakeLists.txt
diff --git a/src/drivers/boards/zubaxgnss-v1/bootloader/CMakeLists.txt b/platforms/nuttx/src/drivers/boards/zubaxgnss-v1/bootloader/CMakeLists.txt
similarity index 94%
rename from src/drivers/boards/zubaxgnss-v1/bootloader/CMakeLists.txt
rename to platforms/nuttx/src/drivers/boards/zubaxgnss-v1/bootloader/CMakeLists.txt
index 963e76174819..da2d8165ac6b 100644
--- a/src/drivers/boards/zubaxgnss-v1/bootloader/CMakeLists.txt
+++ b/platforms/nuttx/src/drivers/boards/zubaxgnss-v1/bootloader/CMakeLists.txt
@@ -39,7 +39,8 @@ add_definitions(
)
include_directories(${px4_bootloader_base}include)
-include_directories(${px4_module_base}systemlib)
+include_directories(${PX4_SOURCE_DIR}/platforms/nuttx/src/modules/systemlib)
+include_directories(${PX4_SOURCE_DIR}/src/modules/systemlib)
include_directories(.)
px4_add_module(
diff --git a/src/drivers/boards/zubaxgnss-v1/bootloader/boot.c b/platforms/nuttx/src/drivers/boards/zubaxgnss-v1/bootloader/boot.c
similarity index 100%
rename from src/drivers/boards/zubaxgnss-v1/bootloader/boot.c
rename to platforms/nuttx/src/drivers/boards/zubaxgnss-v1/bootloader/boot.c
diff --git a/src/drivers/boards/zubaxgnss-v1/bootloader/boot_config.h b/platforms/nuttx/src/drivers/boards/zubaxgnss-v1/bootloader/boot_config.h
similarity index 99%
rename from src/drivers/boards/zubaxgnss-v1/bootloader/boot_config.h
rename to platforms/nuttx/src/drivers/boards/zubaxgnss-v1/bootloader/boot_config.h
index 6c6f1c33875b..986858becff4 100644
--- a/src/drivers/boards/zubaxgnss-v1/bootloader/boot_config.h
+++ b/platforms/nuttx/src/drivers/boards/zubaxgnss-v1/bootloader/boot_config.h
@@ -51,7 +51,7 @@
* todo:make this be pulled in from a targed's build
* files in nuttx*/
-#include "../board_config.h"
+#include "board_config.h"
#include "uavcan.h"
#include
#include
diff --git a/src/drivers/boards/zubaxgnss-v1/bootloader/led.c b/platforms/nuttx/src/drivers/boards/zubaxgnss-v1/bootloader/led.c
similarity index 100%
rename from src/drivers/boards/zubaxgnss-v1/bootloader/led.c
rename to platforms/nuttx/src/drivers/boards/zubaxgnss-v1/bootloader/led.c
diff --git a/src/drivers/boards/zubaxgnss-v1/bootloader/led.h b/platforms/nuttx/src/drivers/boards/zubaxgnss-v1/bootloader/led.h
similarity index 100%
rename from src/drivers/boards/zubaxgnss-v1/bootloader/led.h
rename to platforms/nuttx/src/drivers/boards/zubaxgnss-v1/bootloader/led.h
diff --git a/src/drivers/boards/zubaxgnss-v1/zubax_gnss_init.c b/platforms/nuttx/src/drivers/boards/zubaxgnss-v1/zubax_gnss_init.c
similarity index 100%
rename from src/drivers/boards/zubaxgnss-v1/zubax_gnss_init.c
rename to platforms/nuttx/src/drivers/boards/zubaxgnss-v1/zubax_gnss_init.c
diff --git a/src/drivers/boards/zubaxgnss-v1/zubax_gnss_led.c b/platforms/nuttx/src/drivers/boards/zubaxgnss-v1/zubax_gnss_led.c
similarity index 100%
rename from src/drivers/boards/zubaxgnss-v1/zubax_gnss_led.c
rename to platforms/nuttx/src/drivers/boards/zubaxgnss-v1/zubax_gnss_led.c
diff --git a/src/drivers/bootloaders/include/bitminip.h b/platforms/nuttx/src/drivers/bootloaders/include/bitminip.h
similarity index 100%
rename from src/drivers/bootloaders/include/bitminip.h
rename to platforms/nuttx/src/drivers/bootloaders/include/bitminip.h
diff --git a/src/drivers/bootloaders/include/blsched.h b/platforms/nuttx/src/drivers/bootloaders/include/blsched.h
similarity index 100%
rename from src/drivers/bootloaders/include/blsched.h
rename to platforms/nuttx/src/drivers/bootloaders/include/blsched.h
diff --git a/src/drivers/bootloaders/include/board.h b/platforms/nuttx/src/drivers/bootloaders/include/board.h
similarity index 100%
rename from src/drivers/bootloaders/include/board.h
rename to platforms/nuttx/src/drivers/bootloaders/include/board.h
diff --git a/src/drivers/bootloaders/include/boot_app_shared.h b/platforms/nuttx/src/drivers/bootloaders/include/boot_app_shared.h
similarity index 100%
rename from src/drivers/bootloaders/include/boot_app_shared.h
rename to platforms/nuttx/src/drivers/bootloaders/include/boot_app_shared.h
diff --git a/src/drivers/bootloaders/include/can.h b/platforms/nuttx/src/drivers/bootloaders/include/can.h
similarity index 100%
rename from src/drivers/bootloaders/include/can.h
rename to platforms/nuttx/src/drivers/bootloaders/include/can.h
diff --git a/src/drivers/bootloaders/include/crc.h b/platforms/nuttx/src/drivers/bootloaders/include/crc.h
similarity index 100%
rename from src/drivers/bootloaders/include/crc.h
rename to platforms/nuttx/src/drivers/bootloaders/include/crc.h
diff --git a/src/drivers/bootloaders/include/flash.h b/platforms/nuttx/src/drivers/bootloaders/include/flash.h
similarity index 100%
rename from src/drivers/bootloaders/include/flash.h
rename to platforms/nuttx/src/drivers/bootloaders/include/flash.h
diff --git a/src/drivers/bootloaders/include/random.h b/platforms/nuttx/src/drivers/bootloaders/include/random.h
similarity index 100%
rename from src/drivers/bootloaders/include/random.h
rename to platforms/nuttx/src/drivers/bootloaders/include/random.h
diff --git a/src/drivers/bootloaders/include/timer.h b/platforms/nuttx/src/drivers/bootloaders/include/timer.h
similarity index 100%
rename from src/drivers/bootloaders/include/timer.h
rename to platforms/nuttx/src/drivers/bootloaders/include/timer.h
diff --git a/src/drivers/bootloaders/include/uavcan.h b/platforms/nuttx/src/drivers/bootloaders/include/uavcan.h
similarity index 100%
rename from src/drivers/bootloaders/include/uavcan.h
rename to platforms/nuttx/src/drivers/bootloaders/include/uavcan.h
diff --git a/src/drivers/bootloaders/include/uavcan_can_id_defs.h b/platforms/nuttx/src/drivers/bootloaders/include/uavcan_can_id_defs.h
similarity index 100%
rename from src/drivers/bootloaders/include/uavcan_can_id_defs.h
rename to platforms/nuttx/src/drivers/bootloaders/include/uavcan_can_id_defs.h
diff --git a/src/drivers/bootloaders/include/uavcan_dsdl_defs.h b/platforms/nuttx/src/drivers/bootloaders/include/uavcan_dsdl_defs.h
similarity index 100%
rename from src/drivers/bootloaders/include/uavcan_dsdl_defs.h
rename to platforms/nuttx/src/drivers/bootloaders/include/uavcan_dsdl_defs.h
diff --git a/src/drivers/bootloaders/src/arch/stm32/drivers/can/driver.c b/platforms/nuttx/src/drivers/bootloaders/src/arch/stm32/drivers/can/driver.c
similarity index 100%
rename from src/drivers/bootloaders/src/arch/stm32/drivers/can/driver.c
rename to platforms/nuttx/src/drivers/bootloaders/src/arch/stm32/drivers/can/driver.c
diff --git a/src/drivers/bootloaders/src/common/boot_app_shared.c b/platforms/nuttx/src/drivers/bootloaders/src/common/boot_app_shared.c
similarity index 100%
rename from src/drivers/bootloaders/src/common/boot_app_shared.c
rename to platforms/nuttx/src/drivers/bootloaders/src/common/boot_app_shared.c
diff --git a/src/drivers/bootloaders/src/common/nuttx_stubs.c b/platforms/nuttx/src/drivers/bootloaders/src/common/nuttx_stubs.c
similarity index 100%
rename from src/drivers/bootloaders/src/common/nuttx_stubs.c
rename to platforms/nuttx/src/drivers/bootloaders/src/common/nuttx_stubs.c
diff --git a/src/drivers/bootloaders/src/fs/flash.c b/platforms/nuttx/src/drivers/bootloaders/src/fs/flash.c
similarity index 100%
rename from src/drivers/bootloaders/src/fs/flash.c
rename to platforms/nuttx/src/drivers/bootloaders/src/fs/flash.c
diff --git a/src/drivers/bootloaders/src/protocol/uavcan.c b/platforms/nuttx/src/drivers/bootloaders/src/protocol/uavcan.c
similarity index 100%
rename from src/drivers/bootloaders/src/protocol/uavcan.c
rename to platforms/nuttx/src/drivers/bootloaders/src/protocol/uavcan.c
diff --git a/src/drivers/bootloaders/src/sched/timer.c b/platforms/nuttx/src/drivers/bootloaders/src/sched/timer.c
similarity index 100%
rename from src/drivers/bootloaders/src/sched/timer.c
rename to platforms/nuttx/src/drivers/bootloaders/src/sched/timer.c
diff --git a/src/drivers/bootloaders/src/uavcan/main.c b/platforms/nuttx/src/drivers/bootloaders/src/uavcan/main.c
similarity index 100%
rename from src/drivers/bootloaders/src/uavcan/main.c
rename to platforms/nuttx/src/drivers/bootloaders/src/uavcan/main.c
diff --git a/src/drivers/bootloaders/src/util/crc.c b/platforms/nuttx/src/drivers/bootloaders/src/util/crc.c
similarity index 100%
rename from src/drivers/bootloaders/src/util/crc.c
rename to platforms/nuttx/src/drivers/bootloaders/src/util/crc.c
diff --git a/src/drivers/bootloaders/src/util/random.c b/platforms/nuttx/src/drivers/bootloaders/src/util/random.c
similarity index 100%
rename from src/drivers/bootloaders/src/util/random.c
rename to platforms/nuttx/src/drivers/bootloaders/src/util/random.c
diff --git a/src/drivers/bst/CMakeLists.txt b/platforms/nuttx/src/drivers/bst/CMakeLists.txt
similarity index 100%
rename from src/drivers/bst/CMakeLists.txt
rename to platforms/nuttx/src/drivers/bst/CMakeLists.txt
diff --git a/src/drivers/bst/bst.cpp b/platforms/nuttx/src/drivers/bst/bst.cpp
similarity index 100%
rename from src/drivers/bst/bst.cpp
rename to platforms/nuttx/src/drivers/bst/bst.cpp
diff --git a/platforms/nuttx/src/drivers/device/CMakeLists.txt b/platforms/nuttx/src/drivers/device/CMakeLists.txt
new file mode 100644
index 000000000000..166043acbb03
--- /dev/null
+++ b/platforms/nuttx/src/drivers/device/CMakeLists.txt
@@ -0,0 +1,53 @@
+############################################################################
+#
+# 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.
+#
+############################################################################
+
+include_directories(
+ .
+ ${PX4_SOURCE_DIR}/src/drivers/device)
+
+set(SRCS
+ ${PX4_SOURCE_DIR}/src/drivers/device/ringbuffer.cpp
+ ${PX4_SOURCE_DIR}/src/drivers/device/integrator.cpp
+ device_nuttx.cpp
+ cdev.cpp
+ i2c_nuttx.cpp
+ spi.cpp
+)
+
+px4_add_module(
+ MODULE drivers__device
+ SRCS ${SRCS}
+ DEPENDS
+ platforms__common
+ )
+# vim: set noet ft=cmake fenc=utf-8 ff=unix :
diff --git a/src/drivers/device/cdev.cpp b/platforms/nuttx/src/drivers/device/cdev.cpp
similarity index 100%
rename from src/drivers/device/cdev.cpp
rename to platforms/nuttx/src/drivers/device/cdev.cpp
diff --git a/src/drivers/device/device_nuttx.cpp b/platforms/nuttx/src/drivers/device/device_nuttx.cpp
similarity index 100%
rename from src/drivers/device/device_nuttx.cpp
rename to platforms/nuttx/src/drivers/device/device_nuttx.cpp
diff --git a/src/drivers/device/device_nuttx.h b/platforms/nuttx/src/drivers/device/device_nuttx.h
similarity index 100%
rename from src/drivers/device/device_nuttx.h
rename to platforms/nuttx/src/drivers/device/device_nuttx.h
diff --git a/src/drivers/device/i2c_nuttx.cpp b/platforms/nuttx/src/drivers/device/i2c_nuttx.cpp
similarity index 100%
rename from src/drivers/device/i2c_nuttx.cpp
rename to platforms/nuttx/src/drivers/device/i2c_nuttx.cpp
diff --git a/src/drivers/device/i2c_nuttx.h b/platforms/nuttx/src/drivers/device/i2c_nuttx.h
similarity index 100%
rename from src/drivers/device/i2c_nuttx.h
rename to platforms/nuttx/src/drivers/device/i2c_nuttx.h
diff --git a/src/drivers/device/spi.cpp b/platforms/nuttx/src/drivers/device/spi.cpp
similarity index 100%
rename from src/drivers/device/spi.cpp
rename to platforms/nuttx/src/drivers/device/spi.cpp
diff --git a/src/drivers/ets_airspeed/CMakeLists.txt b/platforms/nuttx/src/drivers/ets_airspeed/CMakeLists.txt
similarity index 100%
rename from src/drivers/ets_airspeed/CMakeLists.txt
rename to platforms/nuttx/src/drivers/ets_airspeed/CMakeLists.txt
diff --git a/src/drivers/ets_airspeed/ets_airspeed.cpp b/platforms/nuttx/src/drivers/ets_airspeed/ets_airspeed.cpp
similarity index 100%
rename from src/drivers/ets_airspeed/ets_airspeed.cpp
rename to platforms/nuttx/src/drivers/ets_airspeed/ets_airspeed.cpp
diff --git a/src/drivers/frsky_telemetry/CMakeLists.txt b/platforms/nuttx/src/drivers/frsky_telemetry/CMakeLists.txt
similarity index 100%
rename from src/drivers/frsky_telemetry/CMakeLists.txt
rename to platforms/nuttx/src/drivers/frsky_telemetry/CMakeLists.txt
diff --git a/src/drivers/frsky_telemetry/common.h b/platforms/nuttx/src/drivers/frsky_telemetry/common.h
similarity index 100%
rename from src/drivers/frsky_telemetry/common.h
rename to platforms/nuttx/src/drivers/frsky_telemetry/common.h
diff --git a/src/drivers/frsky_telemetry/frsky_data.c b/platforms/nuttx/src/drivers/frsky_telemetry/frsky_data.c
similarity index 100%
rename from src/drivers/frsky_telemetry/frsky_data.c
rename to platforms/nuttx/src/drivers/frsky_telemetry/frsky_data.c
diff --git a/src/drivers/frsky_telemetry/frsky_data.h b/platforms/nuttx/src/drivers/frsky_telemetry/frsky_data.h
similarity index 100%
rename from src/drivers/frsky_telemetry/frsky_data.h
rename to platforms/nuttx/src/drivers/frsky_telemetry/frsky_data.h
diff --git a/src/drivers/frsky_telemetry/frsky_telemetry.c b/platforms/nuttx/src/drivers/frsky_telemetry/frsky_telemetry.c
similarity index 100%
rename from src/drivers/frsky_telemetry/frsky_telemetry.c
rename to platforms/nuttx/src/drivers/frsky_telemetry/frsky_telemetry.c
diff --git a/src/drivers/frsky_telemetry/sPort_data.c b/platforms/nuttx/src/drivers/frsky_telemetry/sPort_data.c
similarity index 100%
rename from src/drivers/frsky_telemetry/sPort_data.c
rename to platforms/nuttx/src/drivers/frsky_telemetry/sPort_data.c
diff --git a/src/drivers/frsky_telemetry/sPort_data.h b/platforms/nuttx/src/drivers/frsky_telemetry/sPort_data.h
similarity index 100%
rename from src/drivers/frsky_telemetry/sPort_data.h
rename to platforms/nuttx/src/drivers/frsky_telemetry/sPort_data.h
diff --git a/src/drivers/hc_sr04/CMakeLists.txt b/platforms/nuttx/src/drivers/hc_sr04/CMakeLists.txt
similarity index 100%
rename from src/drivers/hc_sr04/CMakeLists.txt
rename to platforms/nuttx/src/drivers/hc_sr04/CMakeLists.txt
diff --git a/src/drivers/hc_sr04/hc_sr04.cpp b/platforms/nuttx/src/drivers/hc_sr04/hc_sr04.cpp
similarity index 100%
rename from src/drivers/hc_sr04/hc_sr04.cpp
rename to platforms/nuttx/src/drivers/hc_sr04/hc_sr04.cpp
diff --git a/src/drivers/hmc5883/CMakeLists.txt b/platforms/nuttx/src/drivers/hmc5883/CMakeLists.txt
similarity index 100%
rename from src/drivers/hmc5883/CMakeLists.txt
rename to platforms/nuttx/src/drivers/hmc5883/CMakeLists.txt
diff --git a/src/drivers/hmc5883/hmc5883.cpp b/platforms/nuttx/src/drivers/hmc5883/hmc5883.cpp
similarity index 100%
rename from src/drivers/hmc5883/hmc5883.cpp
rename to platforms/nuttx/src/drivers/hmc5883/hmc5883.cpp
diff --git a/src/drivers/hmc5883/hmc5883.h b/platforms/nuttx/src/drivers/hmc5883/hmc5883.h
similarity index 100%
rename from src/drivers/hmc5883/hmc5883.h
rename to platforms/nuttx/src/drivers/hmc5883/hmc5883.h
diff --git a/src/drivers/hmc5883/hmc5883_i2c.cpp b/platforms/nuttx/src/drivers/hmc5883/hmc5883_i2c.cpp
similarity index 100%
rename from src/drivers/hmc5883/hmc5883_i2c.cpp
rename to platforms/nuttx/src/drivers/hmc5883/hmc5883_i2c.cpp
diff --git a/src/drivers/hmc5883/hmc5883_spi.cpp b/platforms/nuttx/src/drivers/hmc5883/hmc5883_spi.cpp
similarity index 100%
rename from src/drivers/hmc5883/hmc5883_spi.cpp
rename to platforms/nuttx/src/drivers/hmc5883/hmc5883_spi.cpp
diff --git a/src/drivers/hott/CMakeLists.txt b/platforms/nuttx/src/drivers/hott/CMakeLists.txt
similarity index 100%
rename from src/drivers/hott/CMakeLists.txt
rename to platforms/nuttx/src/drivers/hott/CMakeLists.txt
diff --git a/src/drivers/hott/comms.cpp b/platforms/nuttx/src/drivers/hott/comms.cpp
similarity index 100%
rename from src/drivers/hott/comms.cpp
rename to platforms/nuttx/src/drivers/hott/comms.cpp
diff --git a/src/drivers/hott/comms.h b/platforms/nuttx/src/drivers/hott/comms.h
similarity index 100%
rename from src/drivers/hott/comms.h
rename to platforms/nuttx/src/drivers/hott/comms.h
diff --git a/src/drivers/hott/hott_sensors/CMakeLists.txt b/platforms/nuttx/src/drivers/hott/hott_sensors/CMakeLists.txt
similarity index 100%
rename from src/drivers/hott/hott_sensors/CMakeLists.txt
rename to platforms/nuttx/src/drivers/hott/hott_sensors/CMakeLists.txt
diff --git a/src/drivers/hott/hott_sensors/hott_sensors.cpp b/platforms/nuttx/src/drivers/hott/hott_sensors/hott_sensors.cpp
similarity index 100%
rename from src/drivers/hott/hott_sensors/hott_sensors.cpp
rename to platforms/nuttx/src/drivers/hott/hott_sensors/hott_sensors.cpp
diff --git a/src/drivers/hott/hott_telemetry/CMakeLists.txt b/platforms/nuttx/src/drivers/hott/hott_telemetry/CMakeLists.txt
similarity index 100%
rename from src/drivers/hott/hott_telemetry/CMakeLists.txt
rename to platforms/nuttx/src/drivers/hott/hott_telemetry/CMakeLists.txt
diff --git a/src/drivers/hott/hott_telemetry/hott_telemetry.cpp b/platforms/nuttx/src/drivers/hott/hott_telemetry/hott_telemetry.cpp
similarity index 100%
rename from src/drivers/hott/hott_telemetry/hott_telemetry.cpp
rename to platforms/nuttx/src/drivers/hott/hott_telemetry/hott_telemetry.cpp
diff --git a/src/drivers/hott/messages.cpp b/platforms/nuttx/src/drivers/hott/messages.cpp
similarity index 100%
rename from src/drivers/hott/messages.cpp
rename to platforms/nuttx/src/drivers/hott/messages.cpp
diff --git a/src/drivers/hott/messages.h b/platforms/nuttx/src/drivers/hott/messages.h
similarity index 100%
rename from src/drivers/hott/messages.h
rename to platforms/nuttx/src/drivers/hott/messages.h
diff --git a/src/drivers/iridiumsbd/CMakeLists.txt b/platforms/nuttx/src/drivers/iridiumsbd/CMakeLists.txt
similarity index 100%
rename from src/drivers/iridiumsbd/CMakeLists.txt
rename to platforms/nuttx/src/drivers/iridiumsbd/CMakeLists.txt
diff --git a/src/drivers/iridiumsbd/IridiumSBD.cpp b/platforms/nuttx/src/drivers/iridiumsbd/IridiumSBD.cpp
similarity index 100%
rename from src/drivers/iridiumsbd/IridiumSBD.cpp
rename to platforms/nuttx/src/drivers/iridiumsbd/IridiumSBD.cpp
diff --git a/src/drivers/iridiumsbd/IridiumSBD.h b/platforms/nuttx/src/drivers/iridiumsbd/IridiumSBD.h
similarity index 100%
rename from src/drivers/iridiumsbd/IridiumSBD.h
rename to platforms/nuttx/src/drivers/iridiumsbd/IridiumSBD.h
diff --git a/src/drivers/iridiumsbd/iridiumsbd_params.c b/platforms/nuttx/src/drivers/iridiumsbd/iridiumsbd_params.c
similarity index 100%
rename from src/drivers/iridiumsbd/iridiumsbd_params.c
rename to platforms/nuttx/src/drivers/iridiumsbd/iridiumsbd_params.c
diff --git a/src/drivers/irlock/CMakeLists.txt b/platforms/nuttx/src/drivers/irlock/CMakeLists.txt
similarity index 100%
rename from src/drivers/irlock/CMakeLists.txt
rename to platforms/nuttx/src/drivers/irlock/CMakeLists.txt
diff --git a/src/drivers/irlock/irlock.cpp b/platforms/nuttx/src/drivers/irlock/irlock.cpp
similarity index 100%
rename from src/drivers/irlock/irlock.cpp
rename to platforms/nuttx/src/drivers/irlock/irlock.cpp
diff --git a/src/drivers/ist8310/CMakeLists.txt b/platforms/nuttx/src/drivers/ist8310/CMakeLists.txt
similarity index 100%
rename from src/drivers/ist8310/CMakeLists.txt
rename to platforms/nuttx/src/drivers/ist8310/CMakeLists.txt
diff --git a/src/drivers/ist8310/ist8310.cpp b/platforms/nuttx/src/drivers/ist8310/ist8310.cpp
similarity index 100%
rename from src/drivers/ist8310/ist8310.cpp
rename to platforms/nuttx/src/drivers/ist8310/ist8310.cpp
diff --git a/src/drivers/l3gd20/CMakeLists.txt b/platforms/nuttx/src/drivers/l3gd20/CMakeLists.txt
similarity index 100%
rename from src/drivers/l3gd20/CMakeLists.txt
rename to platforms/nuttx/src/drivers/l3gd20/CMakeLists.txt
diff --git a/src/drivers/l3gd20/l3gd20.cpp b/platforms/nuttx/src/drivers/l3gd20/l3gd20.cpp
similarity index 100%
rename from src/drivers/l3gd20/l3gd20.cpp
rename to platforms/nuttx/src/drivers/l3gd20/l3gd20.cpp
diff --git a/src/drivers/lis3mdl/CMakeLists.txt b/platforms/nuttx/src/drivers/lis3mdl/CMakeLists.txt
similarity index 100%
rename from src/drivers/lis3mdl/CMakeLists.txt
rename to platforms/nuttx/src/drivers/lis3mdl/CMakeLists.txt
diff --git a/src/drivers/lis3mdl/lis3mdl.cpp b/platforms/nuttx/src/drivers/lis3mdl/lis3mdl.cpp
similarity index 100%
rename from src/drivers/lis3mdl/lis3mdl.cpp
rename to platforms/nuttx/src/drivers/lis3mdl/lis3mdl.cpp
diff --git a/src/drivers/lis3mdl/lis3mdl.h b/platforms/nuttx/src/drivers/lis3mdl/lis3mdl.h
similarity index 100%
rename from src/drivers/lis3mdl/lis3mdl.h
rename to platforms/nuttx/src/drivers/lis3mdl/lis3mdl.h
diff --git a/src/drivers/lis3mdl/lis3mdl_i2c.cpp b/platforms/nuttx/src/drivers/lis3mdl/lis3mdl_i2c.cpp
similarity index 100%
rename from src/drivers/lis3mdl/lis3mdl_i2c.cpp
rename to platforms/nuttx/src/drivers/lis3mdl/lis3mdl_i2c.cpp
diff --git a/src/drivers/lis3mdl/lis3mdl_spi.cpp b/platforms/nuttx/src/drivers/lis3mdl/lis3mdl_spi.cpp
similarity index 100%
rename from src/drivers/lis3mdl/lis3mdl_spi.cpp
rename to platforms/nuttx/src/drivers/lis3mdl/lis3mdl_spi.cpp
diff --git a/src/drivers/ll40ls/CMakeLists.txt b/platforms/nuttx/src/drivers/ll40ls/CMakeLists.txt
similarity index 100%
rename from src/drivers/ll40ls/CMakeLists.txt
rename to platforms/nuttx/src/drivers/ll40ls/CMakeLists.txt
diff --git a/src/drivers/ll40ls/LidarLite.cpp b/platforms/nuttx/src/drivers/ll40ls/LidarLite.cpp
similarity index 100%
rename from src/drivers/ll40ls/LidarLite.cpp
rename to platforms/nuttx/src/drivers/ll40ls/LidarLite.cpp
diff --git a/src/drivers/ll40ls/LidarLite.h b/platforms/nuttx/src/drivers/ll40ls/LidarLite.h
similarity index 100%
rename from src/drivers/ll40ls/LidarLite.h
rename to platforms/nuttx/src/drivers/ll40ls/LidarLite.h
diff --git a/src/drivers/ll40ls/LidarLiteI2C.cpp b/platforms/nuttx/src/drivers/ll40ls/LidarLiteI2C.cpp
similarity index 100%
rename from src/drivers/ll40ls/LidarLiteI2C.cpp
rename to platforms/nuttx/src/drivers/ll40ls/LidarLiteI2C.cpp
diff --git a/src/drivers/ll40ls/LidarLiteI2C.h b/platforms/nuttx/src/drivers/ll40ls/LidarLiteI2C.h
similarity index 100%
rename from src/drivers/ll40ls/LidarLiteI2C.h
rename to platforms/nuttx/src/drivers/ll40ls/LidarLiteI2C.h
diff --git a/src/drivers/ll40ls/LidarLitePWM.cpp b/platforms/nuttx/src/drivers/ll40ls/LidarLitePWM.cpp
similarity index 100%
rename from src/drivers/ll40ls/LidarLitePWM.cpp
rename to platforms/nuttx/src/drivers/ll40ls/LidarLitePWM.cpp
diff --git a/src/drivers/ll40ls/LidarLitePWM.h b/platforms/nuttx/src/drivers/ll40ls/LidarLitePWM.h
similarity index 100%
rename from src/drivers/ll40ls/LidarLitePWM.h
rename to platforms/nuttx/src/drivers/ll40ls/LidarLitePWM.h
diff --git a/src/drivers/ll40ls/ll40ls.cpp b/platforms/nuttx/src/drivers/ll40ls/ll40ls.cpp
similarity index 100%
rename from src/drivers/ll40ls/ll40ls.cpp
rename to platforms/nuttx/src/drivers/ll40ls/ll40ls.cpp
diff --git a/src/drivers/lps25h/CMakeLists.txt b/platforms/nuttx/src/drivers/lps25h/CMakeLists.txt
similarity index 100%
rename from src/drivers/lps25h/CMakeLists.txt
rename to platforms/nuttx/src/drivers/lps25h/CMakeLists.txt
diff --git a/src/drivers/lps25h/lps25h.cpp b/platforms/nuttx/src/drivers/lps25h/lps25h.cpp
similarity index 100%
rename from src/drivers/lps25h/lps25h.cpp
rename to platforms/nuttx/src/drivers/lps25h/lps25h.cpp
diff --git a/src/drivers/lps25h/lps25h.h b/platforms/nuttx/src/drivers/lps25h/lps25h.h
similarity index 100%
rename from src/drivers/lps25h/lps25h.h
rename to platforms/nuttx/src/drivers/lps25h/lps25h.h
diff --git a/src/drivers/lps25h/lps25h_i2c.cpp b/platforms/nuttx/src/drivers/lps25h/lps25h_i2c.cpp
similarity index 100%
rename from src/drivers/lps25h/lps25h_i2c.cpp
rename to platforms/nuttx/src/drivers/lps25h/lps25h_i2c.cpp
diff --git a/src/drivers/lps25h/lps25h_spi.cpp b/platforms/nuttx/src/drivers/lps25h/lps25h_spi.cpp
similarity index 100%
rename from src/drivers/lps25h/lps25h_spi.cpp
rename to platforms/nuttx/src/drivers/lps25h/lps25h_spi.cpp
diff --git a/src/drivers/lsm303d/CMakeLists.txt b/platforms/nuttx/src/drivers/lsm303d/CMakeLists.txt
similarity index 100%
rename from src/drivers/lsm303d/CMakeLists.txt
rename to platforms/nuttx/src/drivers/lsm303d/CMakeLists.txt
diff --git a/src/drivers/lsm303d/lsm303d.cpp b/platforms/nuttx/src/drivers/lsm303d/lsm303d.cpp
similarity index 100%
rename from src/drivers/lsm303d/lsm303d.cpp
rename to platforms/nuttx/src/drivers/lsm303d/lsm303d.cpp
diff --git a/src/drivers/mb12xx/CMakeLists.txt b/platforms/nuttx/src/drivers/mb12xx/CMakeLists.txt
similarity index 100%
rename from src/drivers/mb12xx/CMakeLists.txt
rename to platforms/nuttx/src/drivers/mb12xx/CMakeLists.txt
diff --git a/src/drivers/mb12xx/mb12xx.cpp b/platforms/nuttx/src/drivers/mb12xx/mb12xx.cpp
similarity index 100%
rename from src/drivers/mb12xx/mb12xx.cpp
rename to platforms/nuttx/src/drivers/mb12xx/mb12xx.cpp
diff --git a/src/drivers/md25/BlockSysIdent.cpp b/platforms/nuttx/src/drivers/md25/BlockSysIdent.cpp
similarity index 100%
rename from src/drivers/md25/BlockSysIdent.cpp
rename to platforms/nuttx/src/drivers/md25/BlockSysIdent.cpp
diff --git a/src/drivers/md25/BlockSysIdent.hpp b/platforms/nuttx/src/drivers/md25/BlockSysIdent.hpp
similarity index 100%
rename from src/drivers/md25/BlockSysIdent.hpp
rename to platforms/nuttx/src/drivers/md25/BlockSysIdent.hpp
diff --git a/src/drivers/md25/CMakeLists.txt b/platforms/nuttx/src/drivers/md25/CMakeLists.txt
similarity index 100%
rename from src/drivers/md25/CMakeLists.txt
rename to platforms/nuttx/src/drivers/md25/CMakeLists.txt
diff --git a/src/drivers/md25/md25.cpp b/platforms/nuttx/src/drivers/md25/md25.cpp
similarity index 100%
rename from src/drivers/md25/md25.cpp
rename to platforms/nuttx/src/drivers/md25/md25.cpp
diff --git a/src/drivers/md25/md25.hpp b/platforms/nuttx/src/drivers/md25/md25.hpp
similarity index 100%
rename from src/drivers/md25/md25.hpp
rename to platforms/nuttx/src/drivers/md25/md25.hpp
diff --git a/src/drivers/md25/md25_main.cpp b/platforms/nuttx/src/drivers/md25/md25_main.cpp
similarity index 100%
rename from src/drivers/md25/md25_main.cpp
rename to platforms/nuttx/src/drivers/md25/md25_main.cpp
diff --git a/src/drivers/mkblctrl/CMakeLists.txt b/platforms/nuttx/src/drivers/mkblctrl/CMakeLists.txt
similarity index 100%
rename from src/drivers/mkblctrl/CMakeLists.txt
rename to platforms/nuttx/src/drivers/mkblctrl/CMakeLists.txt
diff --git a/src/drivers/mkblctrl/mkblctrl.cpp b/platforms/nuttx/src/drivers/mkblctrl/mkblctrl.cpp
similarity index 100%
rename from src/drivers/mkblctrl/mkblctrl.cpp
rename to platforms/nuttx/src/drivers/mkblctrl/mkblctrl.cpp
diff --git a/src/drivers/mkblctrl/mkblctrl_params.c b/platforms/nuttx/src/drivers/mkblctrl/mkblctrl_params.c
similarity index 100%
rename from src/drivers/mkblctrl/mkblctrl_params.c
rename to platforms/nuttx/src/drivers/mkblctrl/mkblctrl_params.c
diff --git a/src/drivers/mpu6000/CMakeLists.txt b/platforms/nuttx/src/drivers/mpu6000/CMakeLists.txt
similarity index 100%
rename from src/drivers/mpu6000/CMakeLists.txt
rename to platforms/nuttx/src/drivers/mpu6000/CMakeLists.txt
diff --git a/src/drivers/mpu6000/mpu6000.cpp b/platforms/nuttx/src/drivers/mpu6000/mpu6000.cpp
similarity index 100%
rename from src/drivers/mpu6000/mpu6000.cpp
rename to platforms/nuttx/src/drivers/mpu6000/mpu6000.cpp
diff --git a/src/drivers/mpu6000/mpu6000.h b/platforms/nuttx/src/drivers/mpu6000/mpu6000.h
similarity index 100%
rename from src/drivers/mpu6000/mpu6000.h
rename to platforms/nuttx/src/drivers/mpu6000/mpu6000.h
diff --git a/src/drivers/mpu6000/mpu6000_i2c.cpp b/platforms/nuttx/src/drivers/mpu6000/mpu6000_i2c.cpp
similarity index 100%
rename from src/drivers/mpu6000/mpu6000_i2c.cpp
rename to platforms/nuttx/src/drivers/mpu6000/mpu6000_i2c.cpp
diff --git a/src/drivers/mpu6000/mpu6000_spi.cpp b/platforms/nuttx/src/drivers/mpu6000/mpu6000_spi.cpp
similarity index 100%
rename from src/drivers/mpu6000/mpu6000_spi.cpp
rename to platforms/nuttx/src/drivers/mpu6000/mpu6000_spi.cpp
diff --git a/src/drivers/mpu9250/CMakeLists.txt b/platforms/nuttx/src/drivers/mpu9250/CMakeLists.txt
similarity index 100%
rename from src/drivers/mpu9250/CMakeLists.txt
rename to platforms/nuttx/src/drivers/mpu9250/CMakeLists.txt
diff --git a/src/drivers/mpu9250/gyro.cpp b/platforms/nuttx/src/drivers/mpu9250/gyro.cpp
similarity index 100%
rename from src/drivers/mpu9250/gyro.cpp
rename to platforms/nuttx/src/drivers/mpu9250/gyro.cpp
diff --git a/src/drivers/mpu9250/gyro.h b/platforms/nuttx/src/drivers/mpu9250/gyro.h
similarity index 100%
rename from src/drivers/mpu9250/gyro.h
rename to platforms/nuttx/src/drivers/mpu9250/gyro.h
diff --git a/src/drivers/mpu9250/mag.cpp b/platforms/nuttx/src/drivers/mpu9250/mag.cpp
similarity index 100%
rename from src/drivers/mpu9250/mag.cpp
rename to platforms/nuttx/src/drivers/mpu9250/mag.cpp
diff --git a/src/drivers/mpu9250/mag.h b/platforms/nuttx/src/drivers/mpu9250/mag.h
similarity index 100%
rename from src/drivers/mpu9250/mag.h
rename to platforms/nuttx/src/drivers/mpu9250/mag.h
diff --git a/src/drivers/mpu9250/mag_i2c.cpp b/platforms/nuttx/src/drivers/mpu9250/mag_i2c.cpp
similarity index 100%
rename from src/drivers/mpu9250/mag_i2c.cpp
rename to platforms/nuttx/src/drivers/mpu9250/mag_i2c.cpp
diff --git a/src/drivers/mpu9250/main.cpp b/platforms/nuttx/src/drivers/mpu9250/main.cpp
similarity index 100%
rename from src/drivers/mpu9250/main.cpp
rename to platforms/nuttx/src/drivers/mpu9250/main.cpp
diff --git a/src/drivers/mpu9250/mpu9250.cpp b/platforms/nuttx/src/drivers/mpu9250/mpu9250.cpp
similarity index 100%
rename from src/drivers/mpu9250/mpu9250.cpp
rename to platforms/nuttx/src/drivers/mpu9250/mpu9250.cpp
diff --git a/src/drivers/mpu9250/mpu9250.h b/platforms/nuttx/src/drivers/mpu9250/mpu9250.h
similarity index 100%
rename from src/drivers/mpu9250/mpu9250.h
rename to platforms/nuttx/src/drivers/mpu9250/mpu9250.h
diff --git a/src/drivers/mpu9250/mpu9250_i2c.cpp b/platforms/nuttx/src/drivers/mpu9250/mpu9250_i2c.cpp
similarity index 100%
rename from src/drivers/mpu9250/mpu9250_i2c.cpp
rename to platforms/nuttx/src/drivers/mpu9250/mpu9250_i2c.cpp
diff --git a/src/drivers/mpu9250/mpu9250_spi.cpp b/platforms/nuttx/src/drivers/mpu9250/mpu9250_spi.cpp
similarity index 100%
rename from src/drivers/mpu9250/mpu9250_spi.cpp
rename to platforms/nuttx/src/drivers/mpu9250/mpu9250_spi.cpp
diff --git a/src/drivers/ms4525_airspeed/CMakeLists.txt b/platforms/nuttx/src/drivers/ms4525_airspeed/CMakeLists.txt
similarity index 100%
rename from src/drivers/ms4525_airspeed/CMakeLists.txt
rename to platforms/nuttx/src/drivers/ms4525_airspeed/CMakeLists.txt
diff --git a/src/drivers/ms4525_airspeed/ms4525_airspeed.cpp b/platforms/nuttx/src/drivers/ms4525_airspeed/ms4525_airspeed.cpp
similarity index 100%
rename from src/drivers/ms4525_airspeed/ms4525_airspeed.cpp
rename to platforms/nuttx/src/drivers/ms4525_airspeed/ms4525_airspeed.cpp
diff --git a/src/drivers/ms5525_airspeed/CMakeLists.txt b/platforms/nuttx/src/drivers/ms5525_airspeed/CMakeLists.txt
similarity index 100%
rename from src/drivers/ms5525_airspeed/CMakeLists.txt
rename to platforms/nuttx/src/drivers/ms5525_airspeed/CMakeLists.txt
diff --git a/src/drivers/ms5525_airspeed/MS5525.cpp b/platforms/nuttx/src/drivers/ms5525_airspeed/MS5525.cpp
similarity index 100%
rename from src/drivers/ms5525_airspeed/MS5525.cpp
rename to platforms/nuttx/src/drivers/ms5525_airspeed/MS5525.cpp
diff --git a/src/drivers/ms5525_airspeed/MS5525.hpp b/platforms/nuttx/src/drivers/ms5525_airspeed/MS5525.hpp
similarity index 100%
rename from src/drivers/ms5525_airspeed/MS5525.hpp
rename to platforms/nuttx/src/drivers/ms5525_airspeed/MS5525.hpp
diff --git a/src/drivers/ms5525_airspeed/MS5525_main.cpp b/platforms/nuttx/src/drivers/ms5525_airspeed/MS5525_main.cpp
similarity index 100%
rename from src/drivers/ms5525_airspeed/MS5525_main.cpp
rename to platforms/nuttx/src/drivers/ms5525_airspeed/MS5525_main.cpp
diff --git a/src/drivers/ms5611/CMakeLists.txt b/platforms/nuttx/src/drivers/ms5611/CMakeLists.txt
similarity index 100%
rename from src/drivers/ms5611/CMakeLists.txt
rename to platforms/nuttx/src/drivers/ms5611/CMakeLists.txt
diff --git a/src/drivers/ms5611/ms5611.cpp b/platforms/nuttx/src/drivers/ms5611/ms5611.cpp
similarity index 100%
rename from src/drivers/ms5611/ms5611.cpp
rename to platforms/nuttx/src/drivers/ms5611/ms5611.cpp
diff --git a/src/drivers/ms5611/ms5611.h b/platforms/nuttx/src/drivers/ms5611/ms5611.h
similarity index 100%
rename from src/drivers/ms5611/ms5611.h
rename to platforms/nuttx/src/drivers/ms5611/ms5611.h
diff --git a/src/drivers/ms5611/ms5611_i2c.cpp b/platforms/nuttx/src/drivers/ms5611/ms5611_i2c.cpp
similarity index 100%
rename from src/drivers/ms5611/ms5611_i2c.cpp
rename to platforms/nuttx/src/drivers/ms5611/ms5611_i2c.cpp
diff --git a/src/drivers/ms5611/ms5611_spi.cpp b/platforms/nuttx/src/drivers/ms5611/ms5611_spi.cpp
similarity index 100%
rename from src/drivers/ms5611/ms5611_spi.cpp
rename to platforms/nuttx/src/drivers/ms5611/ms5611_spi.cpp
diff --git a/src/drivers/ocpoc_adc/CMakeLists.txt b/platforms/nuttx/src/drivers/ocpoc_adc/CMakeLists.txt
similarity index 100%
rename from src/drivers/ocpoc_adc/CMakeLists.txt
rename to platforms/nuttx/src/drivers/ocpoc_adc/CMakeLists.txt
diff --git a/src/drivers/ocpoc_adc/ocpoc_adc.cpp b/platforms/nuttx/src/drivers/ocpoc_adc/ocpoc_adc.cpp
similarity index 100%
rename from src/drivers/ocpoc_adc/ocpoc_adc.cpp
rename to platforms/nuttx/src/drivers/ocpoc_adc/ocpoc_adc.cpp
diff --git a/src/drivers/ocpoc_sbus_rc_in/CMakeLists.txt b/platforms/nuttx/src/drivers/ocpoc_sbus_rc_in/CMakeLists.txt
similarity index 100%
rename from src/drivers/ocpoc_sbus_rc_in/CMakeLists.txt
rename to platforms/nuttx/src/drivers/ocpoc_sbus_rc_in/CMakeLists.txt
diff --git a/src/drivers/ocpoc_sbus_rc_in/ocpoc_sbus_rc_in.cpp b/platforms/nuttx/src/drivers/ocpoc_sbus_rc_in/ocpoc_sbus_rc_in.cpp
similarity index 100%
rename from src/drivers/ocpoc_sbus_rc_in/ocpoc_sbus_rc_in.cpp
rename to platforms/nuttx/src/drivers/ocpoc_sbus_rc_in/ocpoc_sbus_rc_in.cpp
diff --git a/src/drivers/oreoled/CMakeLists.txt b/platforms/nuttx/src/drivers/oreoled/CMakeLists.txt
similarity index 100%
rename from src/drivers/oreoled/CMakeLists.txt
rename to platforms/nuttx/src/drivers/oreoled/CMakeLists.txt
diff --git a/src/drivers/oreoled/oreoled.cpp b/platforms/nuttx/src/drivers/oreoled/oreoled.cpp
similarity index 100%
rename from src/drivers/oreoled/oreoled.cpp
rename to platforms/nuttx/src/drivers/oreoled/oreoled.cpp
diff --git a/src/drivers/pca8574/CMakeLists.txt b/platforms/nuttx/src/drivers/pca8574/CMakeLists.txt
similarity index 100%
rename from src/drivers/pca8574/CMakeLists.txt
rename to platforms/nuttx/src/drivers/pca8574/CMakeLists.txt
diff --git a/src/drivers/pca8574/pca8574.cpp b/platforms/nuttx/src/drivers/pca8574/pca8574.cpp
similarity index 100%
rename from src/drivers/pca8574/pca8574.cpp
rename to platforms/nuttx/src/drivers/pca8574/pca8574.cpp
diff --git a/src/drivers/pca9685/CMakeLists.txt b/platforms/nuttx/src/drivers/pca9685/CMakeLists.txt
similarity index 100%
rename from src/drivers/pca9685/CMakeLists.txt
rename to platforms/nuttx/src/drivers/pca9685/CMakeLists.txt
diff --git a/src/drivers/pca9685/arduino_Adafruit_PWM_Servo_Driver_Library_license.txt b/platforms/nuttx/src/drivers/pca9685/arduino_Adafruit_PWM_Servo_Driver_Library_license.txt
similarity index 100%
rename from src/drivers/pca9685/arduino_Adafruit_PWM_Servo_Driver_Library_license.txt
rename to platforms/nuttx/src/drivers/pca9685/arduino_Adafruit_PWM_Servo_Driver_Library_license.txt
diff --git a/src/drivers/pca9685/pca9685.cpp b/platforms/nuttx/src/drivers/pca9685/pca9685.cpp
similarity index 100%
rename from src/drivers/pca9685/pca9685.cpp
rename to platforms/nuttx/src/drivers/pca9685/pca9685.cpp
diff --git a/src/drivers/protocol_splitter/CMakeLists.txt b/platforms/nuttx/src/drivers/protocol_splitter/CMakeLists.txt
similarity index 100%
rename from src/drivers/protocol_splitter/CMakeLists.txt
rename to platforms/nuttx/src/drivers/protocol_splitter/CMakeLists.txt
diff --git a/src/drivers/protocol_splitter/protocol_splitter.cpp b/platforms/nuttx/src/drivers/protocol_splitter/protocol_splitter.cpp
similarity index 100%
rename from src/drivers/protocol_splitter/protocol_splitter.cpp
rename to platforms/nuttx/src/drivers/protocol_splitter/protocol_splitter.cpp
diff --git a/src/drivers/pwm_input/CMakeLists.txt b/platforms/nuttx/src/drivers/pwm_input/CMakeLists.txt
similarity index 100%
rename from src/drivers/pwm_input/CMakeLists.txt
rename to platforms/nuttx/src/drivers/pwm_input/CMakeLists.txt
diff --git a/src/drivers/pwm_input/pwm_input.cpp b/platforms/nuttx/src/drivers/pwm_input/pwm_input.cpp
similarity index 100%
rename from src/drivers/pwm_input/pwm_input.cpp
rename to platforms/nuttx/src/drivers/pwm_input/pwm_input.cpp
diff --git a/src/drivers/px4flow/CMakeLists.txt b/platforms/nuttx/src/drivers/px4flow/CMakeLists.txt
similarity index 100%
rename from src/drivers/px4flow/CMakeLists.txt
rename to platforms/nuttx/src/drivers/px4flow/CMakeLists.txt
diff --git a/src/drivers/px4flow/i2c_frame.h b/platforms/nuttx/src/drivers/px4flow/i2c_frame.h
similarity index 100%
rename from src/drivers/px4flow/i2c_frame.h
rename to platforms/nuttx/src/drivers/px4flow/i2c_frame.h
diff --git a/src/drivers/px4flow/px4flow.cpp b/platforms/nuttx/src/drivers/px4flow/px4flow.cpp
similarity index 100%
rename from src/drivers/px4flow/px4flow.cpp
rename to platforms/nuttx/src/drivers/px4flow/px4flow.cpp
diff --git a/src/drivers/px4fmu/CMakeLists.txt b/platforms/nuttx/src/drivers/px4fmu/CMakeLists.txt
similarity index 96%
rename from src/drivers/px4fmu/CMakeLists.txt
rename to platforms/nuttx/src/drivers/px4fmu/CMakeLists.txt
index 24921c1e5cef..8e690ca0f53e 100644
--- a/src/drivers/px4fmu/CMakeLists.txt
+++ b/platforms/nuttx/src/drivers/px4fmu/CMakeLists.txt
@@ -30,6 +30,9 @@
# POSSIBILITY OF SUCH DAMAGE.
#
############################################################################
+
+include_directories(${PX4_SOURCE_DIR}/src/drivers/device)
+
px4_add_module(
MODULE drivers__px4fmu
MAIN fmu
diff --git a/src/drivers/px4fmu/fmu.cpp b/platforms/nuttx/src/drivers/px4fmu/fmu.cpp
similarity index 100%
rename from src/drivers/px4fmu/fmu.cpp
rename to platforms/nuttx/src/drivers/px4fmu/fmu.cpp
diff --git a/src/drivers/px4fmu/px4fmu_params.c b/platforms/nuttx/src/drivers/px4fmu/px4fmu_params.c
similarity index 100%
rename from src/drivers/px4fmu/px4fmu_params.c
rename to platforms/nuttx/src/drivers/px4fmu/px4fmu_params.c
diff --git a/src/drivers/px4io/CMakeLists.txt b/platforms/nuttx/src/drivers/px4io/CMakeLists.txt
similarity index 100%
rename from src/drivers/px4io/CMakeLists.txt
rename to platforms/nuttx/src/drivers/px4io/CMakeLists.txt
diff --git a/src/drivers/px4io/px4io.cpp b/platforms/nuttx/src/drivers/px4io/px4io.cpp
similarity index 100%
rename from src/drivers/px4io/px4io.cpp
rename to platforms/nuttx/src/drivers/px4io/px4io.cpp
diff --git a/src/drivers/px4io/px4io_driver.h b/platforms/nuttx/src/drivers/px4io/px4io_driver.h
similarity index 100%
rename from src/drivers/px4io/px4io_driver.h
rename to platforms/nuttx/src/drivers/px4io/px4io_driver.h
diff --git a/src/drivers/px4io/px4io_i2c.cpp b/platforms/nuttx/src/drivers/px4io/px4io_i2c.cpp
similarity index 100%
rename from src/drivers/px4io/px4io_i2c.cpp
rename to platforms/nuttx/src/drivers/px4io/px4io_i2c.cpp
diff --git a/src/drivers/px4io/px4io_params.c b/platforms/nuttx/src/drivers/px4io/px4io_params.c
similarity index 100%
rename from src/drivers/px4io/px4io_params.c
rename to platforms/nuttx/src/drivers/px4io/px4io_params.c
diff --git a/src/drivers/px4io/px4io_serial.cpp b/platforms/nuttx/src/drivers/px4io/px4io_serial.cpp
similarity index 100%
rename from src/drivers/px4io/px4io_serial.cpp
rename to platforms/nuttx/src/drivers/px4io/px4io_serial.cpp
diff --git a/src/drivers/px4io/px4io_uploader.cpp b/platforms/nuttx/src/drivers/px4io/px4io_uploader.cpp
similarity index 100%
rename from src/drivers/px4io/px4io_uploader.cpp
rename to platforms/nuttx/src/drivers/px4io/px4io_uploader.cpp
diff --git a/src/drivers/px4io/uploader.h b/platforms/nuttx/src/drivers/px4io/uploader.h
similarity index 100%
rename from src/drivers/px4io/uploader.h
rename to platforms/nuttx/src/drivers/px4io/uploader.h
diff --git a/src/drivers/rgbled_pwm/CMakeLists.txt b/platforms/nuttx/src/drivers/rgbled_pwm/CMakeLists.txt
similarity index 100%
rename from src/drivers/rgbled_pwm/CMakeLists.txt
rename to platforms/nuttx/src/drivers/rgbled_pwm/CMakeLists.txt
diff --git a/src/drivers/rgbled_pwm/rgbled_pwm.cpp b/platforms/nuttx/src/drivers/rgbled_pwm/rgbled_pwm.cpp
similarity index 100%
rename from src/drivers/rgbled_pwm/rgbled_pwm.cpp
rename to platforms/nuttx/src/drivers/rgbled_pwm/rgbled_pwm.cpp
diff --git a/src/drivers/roboclaw/CMakeLists.txt b/platforms/nuttx/src/drivers/roboclaw/CMakeLists.txt
similarity index 100%
rename from src/drivers/roboclaw/CMakeLists.txt
rename to platforms/nuttx/src/drivers/roboclaw/CMakeLists.txt
diff --git a/src/drivers/roboclaw/RoboClaw.cpp b/platforms/nuttx/src/drivers/roboclaw/RoboClaw.cpp
similarity index 100%
rename from src/drivers/roboclaw/RoboClaw.cpp
rename to platforms/nuttx/src/drivers/roboclaw/RoboClaw.cpp
diff --git a/src/drivers/roboclaw/RoboClaw.hpp b/platforms/nuttx/src/drivers/roboclaw/RoboClaw.hpp
similarity index 100%
rename from src/drivers/roboclaw/RoboClaw.hpp
rename to platforms/nuttx/src/drivers/roboclaw/RoboClaw.hpp
diff --git a/src/drivers/roboclaw/roboclaw_main.cpp b/platforms/nuttx/src/drivers/roboclaw/roboclaw_main.cpp
similarity index 100%
rename from src/drivers/roboclaw/roboclaw_main.cpp
rename to platforms/nuttx/src/drivers/roboclaw/roboclaw_main.cpp
diff --git a/src/drivers/sdp3x_airspeed/CMakeLists.txt b/platforms/nuttx/src/drivers/sdp3x_airspeed/CMakeLists.txt
similarity index 100%
rename from src/drivers/sdp3x_airspeed/CMakeLists.txt
rename to platforms/nuttx/src/drivers/sdp3x_airspeed/CMakeLists.txt
diff --git a/src/drivers/sdp3x_airspeed/SDP3X.cpp b/platforms/nuttx/src/drivers/sdp3x_airspeed/SDP3X.cpp
similarity index 100%
rename from src/drivers/sdp3x_airspeed/SDP3X.cpp
rename to platforms/nuttx/src/drivers/sdp3x_airspeed/SDP3X.cpp
diff --git a/src/drivers/sdp3x_airspeed/SDP3X.hpp b/platforms/nuttx/src/drivers/sdp3x_airspeed/SDP3X.hpp
similarity index 100%
rename from src/drivers/sdp3x_airspeed/SDP3X.hpp
rename to platforms/nuttx/src/drivers/sdp3x_airspeed/SDP3X.hpp
diff --git a/src/drivers/sdp3x_airspeed/SDP3X_main.cpp b/platforms/nuttx/src/drivers/sdp3x_airspeed/SDP3X_main.cpp
similarity index 100%
rename from src/drivers/sdp3x_airspeed/SDP3X_main.cpp
rename to platforms/nuttx/src/drivers/sdp3x_airspeed/SDP3X_main.cpp
diff --git a/src/drivers/sf1xx/CMakeLists.txt b/platforms/nuttx/src/drivers/sf1xx/CMakeLists.txt
similarity index 100%
rename from src/drivers/sf1xx/CMakeLists.txt
rename to platforms/nuttx/src/drivers/sf1xx/CMakeLists.txt
diff --git a/src/drivers/sf1xx/sf1xx.cpp b/platforms/nuttx/src/drivers/sf1xx/sf1xx.cpp
similarity index 100%
rename from src/drivers/sf1xx/sf1xx.cpp
rename to platforms/nuttx/src/drivers/sf1xx/sf1xx.cpp
diff --git a/src/drivers/srf02/CMakeLists.txt b/platforms/nuttx/src/drivers/srf02/CMakeLists.txt
similarity index 100%
rename from src/drivers/srf02/CMakeLists.txt
rename to platforms/nuttx/src/drivers/srf02/CMakeLists.txt
diff --git a/src/drivers/srf02/srf02.cpp b/platforms/nuttx/src/drivers/srf02/srf02.cpp
similarity index 100%
rename from src/drivers/srf02/srf02.cpp
rename to platforms/nuttx/src/drivers/srf02/srf02.cpp
diff --git a/src/drivers/srf02_i2c/CMakeLists.txt b/platforms/nuttx/src/drivers/srf02_i2c/CMakeLists.txt
similarity index 100%
rename from src/drivers/srf02_i2c/CMakeLists.txt
rename to platforms/nuttx/src/drivers/srf02_i2c/CMakeLists.txt
diff --git a/src/drivers/srf02_i2c/srf02_i2c.cpp b/platforms/nuttx/src/drivers/srf02_i2c/srf02_i2c.cpp
similarity index 100%
rename from src/drivers/srf02_i2c/srf02_i2c.cpp
rename to platforms/nuttx/src/drivers/srf02_i2c/srf02_i2c.cpp
diff --git a/src/drivers/stm32/CMakeLists.txt b/platforms/nuttx/src/drivers/stm32/CMakeLists.txt
similarity index 100%
rename from src/drivers/stm32/CMakeLists.txt
rename to platforms/nuttx/src/drivers/stm32/CMakeLists.txt
diff --git a/src/drivers/stm32/adc/CMakeLists.txt b/platforms/nuttx/src/drivers/stm32/adc/CMakeLists.txt
similarity index 100%
rename from src/drivers/stm32/adc/CMakeLists.txt
rename to platforms/nuttx/src/drivers/stm32/adc/CMakeLists.txt
diff --git a/src/drivers/stm32/adc/adc.cpp b/platforms/nuttx/src/drivers/stm32/adc/adc.cpp
similarity index 100%
rename from src/drivers/stm32/adc/adc.cpp
rename to platforms/nuttx/src/drivers/stm32/adc/adc.cpp
diff --git a/src/drivers/stm32/drv_hrt.c b/platforms/nuttx/src/drivers/stm32/drv_hrt.c
similarity index 100%
rename from src/drivers/stm32/drv_hrt.c
rename to platforms/nuttx/src/drivers/stm32/drv_hrt.c
diff --git a/src/drivers/stm32/drv_input_capture.c b/platforms/nuttx/src/drivers/stm32/drv_input_capture.c
similarity index 100%
rename from src/drivers/stm32/drv_input_capture.c
rename to platforms/nuttx/src/drivers/stm32/drv_input_capture.c
diff --git a/src/drivers/stm32/drv_input_capture.h b/platforms/nuttx/src/drivers/stm32/drv_input_capture.h
similarity index 100%
rename from src/drivers/stm32/drv_input_capture.h
rename to platforms/nuttx/src/drivers/stm32/drv_input_capture.h
diff --git a/src/drivers/stm32/drv_io_timer.c b/platforms/nuttx/src/drivers/stm32/drv_io_timer.c
similarity index 100%
rename from src/drivers/stm32/drv_io_timer.c
rename to platforms/nuttx/src/drivers/stm32/drv_io_timer.c
diff --git a/src/drivers/stm32/drv_io_timer.h b/platforms/nuttx/src/drivers/stm32/drv_io_timer.h
similarity index 100%
rename from src/drivers/stm32/drv_io_timer.h
rename to platforms/nuttx/src/drivers/stm32/drv_io_timer.h
diff --git a/src/drivers/stm32/drv_led_pwm.cpp b/platforms/nuttx/src/drivers/stm32/drv_led_pwm.cpp
similarity index 100%
rename from src/drivers/stm32/drv_led_pwm.cpp
rename to platforms/nuttx/src/drivers/stm32/drv_led_pwm.cpp
diff --git a/src/drivers/stm32/drv_pwm_servo.c b/platforms/nuttx/src/drivers/stm32/drv_pwm_servo.c
similarity index 100%
rename from src/drivers/stm32/drv_pwm_servo.c
rename to platforms/nuttx/src/drivers/stm32/drv_pwm_servo.c
diff --git a/src/drivers/stm32/drv_pwm_servo.h b/platforms/nuttx/src/drivers/stm32/drv_pwm_servo.h
similarity index 100%
rename from src/drivers/stm32/drv_pwm_servo.h
rename to platforms/nuttx/src/drivers/stm32/drv_pwm_servo.h
diff --git a/src/drivers/stm32/drv_pwm_trigger.c b/platforms/nuttx/src/drivers/stm32/drv_pwm_trigger.c
similarity index 100%
rename from src/drivers/stm32/drv_pwm_trigger.c
rename to platforms/nuttx/src/drivers/stm32/drv_pwm_trigger.c
diff --git a/src/drivers/stm32/drv_pwm_trigger.h b/platforms/nuttx/src/drivers/stm32/drv_pwm_trigger.h
similarity index 100%
rename from src/drivers/stm32/drv_pwm_trigger.h
rename to platforms/nuttx/src/drivers/stm32/drv_pwm_trigger.h
diff --git a/src/drivers/stm32/tone_alarm/CMakeLists.txt b/platforms/nuttx/src/drivers/stm32/tone_alarm/CMakeLists.txt
similarity index 100%
rename from src/drivers/stm32/tone_alarm/CMakeLists.txt
rename to platforms/nuttx/src/drivers/stm32/tone_alarm/CMakeLists.txt
diff --git a/src/drivers/stm32/tone_alarm/tone_alarm.cpp b/platforms/nuttx/src/drivers/stm32/tone_alarm/tone_alarm.cpp
similarity index 100%
rename from src/drivers/stm32/tone_alarm/tone_alarm.cpp
rename to platforms/nuttx/src/drivers/stm32/tone_alarm/tone_alarm.cpp
diff --git a/src/drivers/tap_esc/CMakeLists.txt b/platforms/nuttx/src/drivers/tap_esc/CMakeLists.txt
similarity index 100%
rename from src/drivers/tap_esc/CMakeLists.txt
rename to platforms/nuttx/src/drivers/tap_esc/CMakeLists.txt
diff --git a/src/drivers/tap_esc/drv_tap_esc.h b/platforms/nuttx/src/drivers/tap_esc/drv_tap_esc.h
similarity index 100%
rename from src/drivers/tap_esc/drv_tap_esc.h
rename to platforms/nuttx/src/drivers/tap_esc/drv_tap_esc.h
diff --git a/src/drivers/tap_esc/tap_esc.cpp b/platforms/nuttx/src/drivers/tap_esc/tap_esc.cpp
similarity index 100%
rename from src/drivers/tap_esc/tap_esc.cpp
rename to platforms/nuttx/src/drivers/tap_esc/tap_esc.cpp
diff --git a/src/drivers/tap_esc/tap_esc_common.cpp b/platforms/nuttx/src/drivers/tap_esc/tap_esc_common.cpp
similarity index 100%
rename from src/drivers/tap_esc/tap_esc_common.cpp
rename to platforms/nuttx/src/drivers/tap_esc/tap_esc_common.cpp
diff --git a/src/drivers/tap_esc/tap_esc_common.h b/platforms/nuttx/src/drivers/tap_esc/tap_esc_common.h
similarity index 100%
rename from src/drivers/tap_esc/tap_esc_common.h
rename to platforms/nuttx/src/drivers/tap_esc/tap_esc_common.h
diff --git a/src/drivers/test_ppm/CMakeLists.txt b/platforms/nuttx/src/drivers/test_ppm/CMakeLists.txt
similarity index 100%
rename from src/drivers/test_ppm/CMakeLists.txt
rename to platforms/nuttx/src/drivers/test_ppm/CMakeLists.txt
diff --git a/src/drivers/test_ppm/test_ppm.cpp b/platforms/nuttx/src/drivers/test_ppm/test_ppm.cpp
similarity index 100%
rename from src/drivers/test_ppm/test_ppm.cpp
rename to platforms/nuttx/src/drivers/test_ppm/test_ppm.cpp
diff --git a/src/drivers/trone/CMakeLists.txt b/platforms/nuttx/src/drivers/trone/CMakeLists.txt
similarity index 100%
rename from src/drivers/trone/CMakeLists.txt
rename to platforms/nuttx/src/drivers/trone/CMakeLists.txt
diff --git a/src/drivers/trone/trone.cpp b/platforms/nuttx/src/drivers/trone/trone.cpp
similarity index 100%
rename from src/drivers/trone/trone.cpp
rename to platforms/nuttx/src/drivers/trone/trone.cpp
diff --git a/src/drivers/ulanding/CMakeLists.txt b/platforms/nuttx/src/drivers/ulanding/CMakeLists.txt
similarity index 100%
rename from src/drivers/ulanding/CMakeLists.txt
rename to platforms/nuttx/src/drivers/ulanding/CMakeLists.txt
diff --git a/src/drivers/ulanding/ulanding.cpp b/platforms/nuttx/src/drivers/ulanding/ulanding.cpp
similarity index 100%
rename from src/drivers/ulanding/ulanding.cpp
rename to platforms/nuttx/src/drivers/ulanding/ulanding.cpp
diff --git a/src/firmware/nuttx/CMakeLists.txt b/platforms/nuttx/src/firmware/nuttx/CMakeLists.txt
similarity index 91%
rename from src/firmware/nuttx/CMakeLists.txt
rename to platforms/nuttx/src/firmware/nuttx/CMakeLists.txt
index 8de947001ef8..685757e89ecb 100644
--- a/src/firmware/nuttx/CMakeLists.txt
+++ b/platforms/nuttx/src/firmware/nuttx/CMakeLists.txt
@@ -85,7 +85,7 @@ if(NOT ${BOARD} STREQUAL "sim")
if ("${romfs_used}" STREQUAL "y")
if (config_io_board)
- set(extras "${CMAKE_BINARY_DIR}/src/modules/px4iofirmware/${config_io_board}.bin")
+ set(extras "${CMAKE_BINARY_DIR}/platforms/nuttx/src/modules/px4iofirmware/${config_io_board}.bin")
endif()
message(STATUS "Adding ROMFS on ${BOARD}")
@@ -135,21 +135,21 @@ if(NOT ${BOARD} STREQUAL "sim")
add_custom_target(debug_io
COMMAND ${GDB}
- ${PX4_BINARY_DIR}/src/modules/px4iofirmware/${config_io_board}
+ ${PX4_BINARY_DIR}/platforms/nuttx/src/modules/px4iofirmware/${config_io_board}
DEPENDS firmware_nuttx
${CMAKE_CURRENT_BINARY_DIR}/.gdbinit
)
add_custom_target(debug_io_tui
COMMAND ${GDBTUI}
- ${PX4_BINARY_DIR}/src/modules/px4iofirmware/${config_io_board}
+ ${PX4_BINARY_DIR}/platforms/nuttx/src/modules/px4iofirmware/${config_io_board}
DEPENDS firmware_nuttx
${CMAKE_CURRENT_BINARY_DIR}/.gdbinit
)
add_custom_target(debug_io_ddd
COMMAND ${DDD} --debugger ${GDB}
- ${PX4_BINARY_DIR}/src/modules/px4iofirmware/${config_io_board}
+ ${PX4_BINARY_DIR}/platforms/nuttx/src/modules/px4iofirmware/${config_io_board}
DEPENDS firmware_nuttx
${CMAKE_CURRENT_BINARY_DIR}/.gdbinit
)
diff --git a/src/firmware/nuttx/gdbinit.in b/platforms/nuttx/src/firmware/nuttx/gdbinit.in
similarity index 100%
rename from src/firmware/nuttx/gdbinit.in
rename to platforms/nuttx/src/firmware/nuttx/gdbinit.in
diff --git a/platforms/nuttx/src/lib/version/CMakeLists.txt b/platforms/nuttx/src/lib/version/CMakeLists.txt
new file mode 100644
index 000000000000..7f7bdc738eaf
--- /dev/null
+++ b/platforms/nuttx/src/lib/version/CMakeLists.txt
@@ -0,0 +1,60 @@
+############################################################################
+#
+# Copyright (c) 2016 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_custom_command(
+ OUTPUT nuttx_version.h
+ COMMAND ${PYTHON_EXECUTABLE} ${PX4_SOURCE_DIR}/platforms/${OS}/Tools/px_update_git_nuttx_header.py nuttx_version.h ${PX4_SOURCE_DIR} > ${PX4_BINARY_DIR}/git_nuttx_header.log
+ DEPENDS prebuild_targets
+ WORKING_DIRECTORY ${CMAKE_CURRENT_BINARY_DIR}
+ COMMENT "Generating OS specific git hash header"
+ )
+set_source_files_properties(nuttx_version.h PROPERTIES GENERATED TRUE)
+add_custom_target(ver_gen_nuttx ALL DEPENDS nuttx_version.h)
+
+include_directories(
+ ${PX4_SOURCE_DIR}/src/lib/version
+ ${CMAKE_CURRENT_BINARY_DIR}
+ )
+
+px4_add_module(
+ MODULE lib__version
+ COMPILE_FLAGS
+ SRCS
+ ${PX4_SOURCE_DIR}/src/lib/version/version.c
+ version_nuttx.c
+ DEPENDS
+ ver_gen
+ ver_gen_nuttx
+ platforms__common
+ )
+# vim: set noet ft=cmake fenc=utf-8 ff=unix :
diff --git a/platforms/nuttx/src/lib/version/version_nuttx.c b/platforms/nuttx/src/lib/version/version_nuttx.c
new file mode 100644
index 000000000000..9fac809ca803
--- /dev/null
+++ b/platforms/nuttx/src/lib/version/version_nuttx.c
@@ -0,0 +1,65 @@
+/****************************************************************************
+ *
+ * Copyright (c) 2016 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.
+ *
+ ****************************************************************************/
+
+#include "version.h"
+
+#include "build_git_version.h" //generated from px_update_git_header.py
+#include "nuttx_version.h" //generated from CMakeLists.txt
+
+#include
+
+#if !defined(CONFIG_CDCACM_PRODUCTID)
+# define CONFIG_CDCACM_PRODUCTID 0
+#endif
+
+extern uint32_t version_tag_to_number(const char *tag);
+
+uint32_t px4_board_version(void)
+{
+ return CONFIG_CDCACM_PRODUCTID;
+}
+
+uint32_t px4_os_version(void)
+{
+ return version_tag_to_number(NUTTX_GIT_TAG_STR);
+}
+
+const char *px4_os_version_string(void)
+{
+ return NUTTX_GIT_VERSION_STR;
+}
+
+const char *px4_os_name(void)
+{
+ return "NuttX";
+}
diff --git a/src/modules/px4iofirmware/CMakeLists.txt b/platforms/nuttx/src/modules/px4iofirmware/CMakeLists.txt
similarity index 90%
rename from src/modules/px4iofirmware/CMakeLists.txt
rename to platforms/nuttx/src/modules/px4iofirmware/CMakeLists.txt
index b29d5b1f8668..22b3f38f941b 100644
--- a/src/modules/px4iofirmware/CMakeLists.txt
+++ b/platforms/nuttx/src/modules/px4iofirmware/CMakeLists.txt
@@ -73,11 +73,11 @@ link_directories(${link_dirs})
add_definitions(${definitions})
set(srcs
- ${PX4_SOURCE_DIR}/src/drivers/boards/${config_io_board}/px4io_init.c
- ${PX4_SOURCE_DIR}/src/drivers/boards/${config_io_board}/px4io_timer_config.c
- ${PX4_SOURCE_DIR}/src/drivers/stm32/drv_hrt.c
- ${PX4_SOURCE_DIR}/src/drivers/stm32/drv_io_timer.c
- ${PX4_SOURCE_DIR}/src/drivers/stm32/drv_pwm_servo.c
+ ${PX4_SOURCE_DIR}/platforms/nuttx/src/drivers/boards/${config_io_board}/px4io_init.c
+ ${PX4_SOURCE_DIR}/platforms/nuttx/src/drivers/boards/${config_io_board}/px4io_timer_config.c
+ ${PX4_SOURCE_DIR}/platforms/nuttx/src/drivers/stm32/drv_hrt.c
+ ${PX4_SOURCE_DIR}/platforms/nuttx/src/drivers/stm32/drv_io_timer.c
+ ${PX4_SOURCE_DIR}/platforms/nuttx/src/drivers/stm32/drv_pwm_servo.c
${PX4_SOURCE_DIR}/src/lib/rc/dsm.cpp
${PX4_SOURCE_DIR}/src/lib/rc/sbus.cpp
${PX4_SOURCE_DIR}/src/lib/rc/st24.cpp
@@ -90,7 +90,7 @@ set(srcs
${PX4_SOURCE_DIR}/src/modules/systemlib/mixer/mixer_simple.cpp
${PX4_SOURCE_DIR}/src/modules/systemlib/perf_counter.c
${PX4_SOURCE_DIR}/src/modules/systemlib/pwm_limit/pwm_limit.c
- ${PX4_SOURCE_DIR}/src/modules/systemlib/up_cxxinitialize.c
+ ${PX4_SOURCE_DIR}/platforms/nuttx/src/modules/systemlib/up_cxxinitialize.c
adc.c
controls.c
mixer.cpp
diff --git a/src/modules/px4iofirmware/adc.c b/platforms/nuttx/src/modules/px4iofirmware/adc.c
similarity index 100%
rename from src/modules/px4iofirmware/adc.c
rename to platforms/nuttx/src/modules/px4iofirmware/adc.c
diff --git a/src/modules/px4iofirmware/controls.c b/platforms/nuttx/src/modules/px4iofirmware/controls.c
similarity index 100%
rename from src/modules/px4iofirmware/controls.c
rename to platforms/nuttx/src/modules/px4iofirmware/controls.c
diff --git a/src/modules/px4iofirmware/i2c.c b/platforms/nuttx/src/modules/px4iofirmware/i2c.c
similarity index 100%
rename from src/modules/px4iofirmware/i2c.c
rename to platforms/nuttx/src/modules/px4iofirmware/i2c.c
diff --git a/src/modules/px4iofirmware/mixer.cpp b/platforms/nuttx/src/modules/px4iofirmware/mixer.cpp
similarity index 100%
rename from src/modules/px4iofirmware/mixer.cpp
rename to platforms/nuttx/src/modules/px4iofirmware/mixer.cpp
diff --git a/src/modules/px4iofirmware/mixer.h b/platforms/nuttx/src/modules/px4iofirmware/mixer.h
similarity index 100%
rename from src/modules/px4iofirmware/mixer.h
rename to platforms/nuttx/src/modules/px4iofirmware/mixer.h
diff --git a/src/modules/px4iofirmware/protocol.h b/platforms/nuttx/src/modules/px4iofirmware/protocol.h
similarity index 100%
rename from src/modules/px4iofirmware/protocol.h
rename to platforms/nuttx/src/modules/px4iofirmware/protocol.h
diff --git a/src/modules/px4iofirmware/px4io.c b/platforms/nuttx/src/modules/px4iofirmware/px4io.c
similarity index 100%
rename from src/modules/px4iofirmware/px4io.c
rename to platforms/nuttx/src/modules/px4iofirmware/px4io.c
diff --git a/src/modules/px4iofirmware/px4io.h b/platforms/nuttx/src/modules/px4iofirmware/px4io.h
similarity index 100%
rename from src/modules/px4iofirmware/px4io.h
rename to platforms/nuttx/src/modules/px4iofirmware/px4io.h
diff --git a/src/modules/px4iofirmware/registers.c b/platforms/nuttx/src/modules/px4iofirmware/registers.c
similarity index 100%
rename from src/modules/px4iofirmware/registers.c
rename to platforms/nuttx/src/modules/px4iofirmware/registers.c
diff --git a/src/modules/px4iofirmware/safety.c b/platforms/nuttx/src/modules/px4iofirmware/safety.c
similarity index 100%
rename from src/modules/px4iofirmware/safety.c
rename to platforms/nuttx/src/modules/px4iofirmware/safety.c
diff --git a/src/modules/px4iofirmware/serial.c b/platforms/nuttx/src/modules/px4iofirmware/serial.c
similarity index 100%
rename from src/modules/px4iofirmware/serial.c
rename to platforms/nuttx/src/modules/px4iofirmware/serial.c
diff --git a/platforms/nuttx/src/modules/systemlib/CMakeLists.txt b/platforms/nuttx/src/modules/systemlib/CMakeLists.txt
new file mode 100644
index 000000000000..280f86b4dcd4
--- /dev/null
+++ b/platforms/nuttx/src/modules/systemlib/CMakeLists.txt
@@ -0,0 +1,67 @@
+############################################################################
+#
+# 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.
+#
+############################################################################
+
+include_directories(${PX4_SOURCE_DIR}/src/modules/systemlib)
+
+set(SRCS
+ ${PX4_SOURCE_DIR}/src/modules/systemlib/perf_counter.c
+ ${PX4_SOURCE_DIR}/src/modules/systemlib/conversions.c
+ ${PX4_SOURCE_DIR}/src/modules/systemlib/cpuload.c
+ ${PX4_SOURCE_DIR}/src/modules/systemlib/pid/pid.c
+ ${PX4_SOURCE_DIR}/src/modules/systemlib/airspeed.c
+ ${PX4_SOURCE_DIR}/src/modules/systemlib/mavlink_log.c
+ ${PX4_SOURCE_DIR}/src/modules/systemlib/rc_check.c
+ ${PX4_SOURCE_DIR}/src/modules/systemlib/otp.c
+ ${PX4_SOURCE_DIR}/src/modules/systemlib/board_serial.c
+ ${PX4_SOURCE_DIR}/src/modules/systemlib/pwm_limit/pwm_limit.c
+ ${PX4_SOURCE_DIR}/src/modules/systemlib/bson/tinybson.c
+ ${PX4_SOURCE_DIR}/src/modules/systemlib/circuit_breaker.cpp
+ ${PX4_SOURCE_DIR}/src/modules/systemlib/battery.cpp
+ ${PX4_SOURCE_DIR}/src/modules/systemlib/hysteresis/hysteresis.cpp
+ ${PX4_SOURCE_DIR}/src/modules/systemlib/hx_stream.c
+ err.c
+ printload.c
+ flashparams/flashparams.c
+ flashparams/flashfs.c
+ up_cxxinitialize.c
+ )
+
+px4_add_module(
+ MODULE modules__systemlib
+ COMPILE_FLAGS
+ -Wno-sign-compare
+ SRCS ${SRCS}
+ DEPENDS
+ platforms__common
+ )
+# vim: set noet ft=cmake fenc=utf-8 ff=unix :
diff --git a/src/modules/systemlib/err.c b/platforms/nuttx/src/modules/systemlib/err.c
similarity index 100%
rename from src/modules/systemlib/err.c
rename to platforms/nuttx/src/modules/systemlib/err.c
diff --git a/src/modules/systemlib/flashparams/flashfs.c b/platforms/nuttx/src/modules/systemlib/flashparams/flashfs.c
similarity index 100%
rename from src/modules/systemlib/flashparams/flashfs.c
rename to platforms/nuttx/src/modules/systemlib/flashparams/flashfs.c
diff --git a/src/modules/systemlib/flashparams/flashfs.h b/platforms/nuttx/src/modules/systemlib/flashparams/flashfs.h
similarity index 100%
rename from src/modules/systemlib/flashparams/flashfs.h
rename to platforms/nuttx/src/modules/systemlib/flashparams/flashfs.h
diff --git a/src/modules/systemlib/flashparams/flashparams.c b/platforms/nuttx/src/modules/systemlib/flashparams/flashparams.c
similarity index 100%
rename from src/modules/systemlib/flashparams/flashparams.c
rename to platforms/nuttx/src/modules/systemlib/flashparams/flashparams.c
diff --git a/src/modules/systemlib/flashparams/flashparams.h b/platforms/nuttx/src/modules/systemlib/flashparams/flashparams.h
similarity index 100%
rename from src/modules/systemlib/flashparams/flashparams.h
rename to platforms/nuttx/src/modules/systemlib/flashparams/flashparams.h
diff --git a/src/modules/systemlib/hardfault_log.h b/platforms/nuttx/src/modules/systemlib/hardfault_log.h
similarity index 100%
rename from src/modules/systemlib/hardfault_log.h
rename to platforms/nuttx/src/modules/systemlib/hardfault_log.h
diff --git a/src/modules/systemlib/ppm_decode.c b/platforms/nuttx/src/modules/systemlib/ppm_decode.c
similarity index 100%
rename from src/modules/systemlib/ppm_decode.c
rename to platforms/nuttx/src/modules/systemlib/ppm_decode.c
diff --git a/src/modules/systemlib/ppm_decode.h b/platforms/nuttx/src/modules/systemlib/ppm_decode.h
similarity index 100%
rename from src/modules/systemlib/ppm_decode.h
rename to platforms/nuttx/src/modules/systemlib/ppm_decode.h
diff --git a/src/modules/systemlib/printload.c b/platforms/nuttx/src/modules/systemlib/printload.c
similarity index 100%
rename from src/modules/systemlib/printload.c
rename to platforms/nuttx/src/modules/systemlib/printload.c
diff --git a/src/modules/systemlib/up_cxxinitialize.c b/platforms/nuttx/src/modules/systemlib/up_cxxinitialize.c
similarity index 100%
rename from src/modules/systemlib/up_cxxinitialize.c
rename to platforms/nuttx/src/modules/systemlib/up_cxxinitialize.c
diff --git a/src/modules/uavcan/.gitignore b/platforms/nuttx/src/modules/uavcan/.gitignore
similarity index 100%
rename from src/modules/uavcan/.gitignore
rename to platforms/nuttx/src/modules/uavcan/.gitignore
diff --git a/src/modules/uavcan/CMakeLists.txt b/platforms/nuttx/src/modules/uavcan/CMakeLists.txt
similarity index 100%
rename from src/modules/uavcan/CMakeLists.txt
rename to platforms/nuttx/src/modules/uavcan/CMakeLists.txt
diff --git a/src/modules/uavcan/actuators/esc.cpp b/platforms/nuttx/src/modules/uavcan/actuators/esc.cpp
similarity index 100%
rename from src/modules/uavcan/actuators/esc.cpp
rename to platforms/nuttx/src/modules/uavcan/actuators/esc.cpp
diff --git a/src/modules/uavcan/actuators/esc.hpp b/platforms/nuttx/src/modules/uavcan/actuators/esc.hpp
similarity index 100%
rename from src/modules/uavcan/actuators/esc.hpp
rename to platforms/nuttx/src/modules/uavcan/actuators/esc.hpp
diff --git a/src/modules/uavcan/actuators/hardpoint.cpp b/platforms/nuttx/src/modules/uavcan/actuators/hardpoint.cpp
similarity index 100%
rename from src/modules/uavcan/actuators/hardpoint.cpp
rename to platforms/nuttx/src/modules/uavcan/actuators/hardpoint.cpp
diff --git a/src/modules/uavcan/actuators/hardpoint.hpp b/platforms/nuttx/src/modules/uavcan/actuators/hardpoint.hpp
similarity index 100%
rename from src/modules/uavcan/actuators/hardpoint.hpp
rename to platforms/nuttx/src/modules/uavcan/actuators/hardpoint.hpp
diff --git a/src/modules/uavcan/allocator.hpp b/platforms/nuttx/src/modules/uavcan/allocator.hpp
similarity index 100%
rename from src/modules/uavcan/allocator.hpp
rename to platforms/nuttx/src/modules/uavcan/allocator.hpp
diff --git a/platforms/nuttx/src/modules/uavcan/libuavcan b/platforms/nuttx/src/modules/uavcan/libuavcan
new file mode 160000
index 000000000000..f45be6fe5805
--- /dev/null
+++ b/platforms/nuttx/src/modules/uavcan/libuavcan
@@ -0,0 +1 @@
+Subproject commit f45be6fe58054c1de5cc4ae4a856d8e0ad1e4600
diff --git a/src/modules/uavcan/sensors/baro.cpp b/platforms/nuttx/src/modules/uavcan/sensors/baro.cpp
similarity index 100%
rename from src/modules/uavcan/sensors/baro.cpp
rename to platforms/nuttx/src/modules/uavcan/sensors/baro.cpp
diff --git a/src/modules/uavcan/sensors/baro.hpp b/platforms/nuttx/src/modules/uavcan/sensors/baro.hpp
similarity index 100%
rename from src/modules/uavcan/sensors/baro.hpp
rename to platforms/nuttx/src/modules/uavcan/sensors/baro.hpp
diff --git a/src/modules/uavcan/sensors/gnss.cpp b/platforms/nuttx/src/modules/uavcan/sensors/gnss.cpp
similarity index 100%
rename from src/modules/uavcan/sensors/gnss.cpp
rename to platforms/nuttx/src/modules/uavcan/sensors/gnss.cpp
diff --git a/src/modules/uavcan/sensors/gnss.hpp b/platforms/nuttx/src/modules/uavcan/sensors/gnss.hpp
similarity index 100%
rename from src/modules/uavcan/sensors/gnss.hpp
rename to platforms/nuttx/src/modules/uavcan/sensors/gnss.hpp
diff --git a/src/modules/uavcan/sensors/mag.cpp b/platforms/nuttx/src/modules/uavcan/sensors/mag.cpp
similarity index 100%
rename from src/modules/uavcan/sensors/mag.cpp
rename to platforms/nuttx/src/modules/uavcan/sensors/mag.cpp
diff --git a/src/modules/uavcan/sensors/mag.hpp b/platforms/nuttx/src/modules/uavcan/sensors/mag.hpp
similarity index 100%
rename from src/modules/uavcan/sensors/mag.hpp
rename to platforms/nuttx/src/modules/uavcan/sensors/mag.hpp
diff --git a/src/modules/uavcan/sensors/sensor_bridge.cpp b/platforms/nuttx/src/modules/uavcan/sensors/sensor_bridge.cpp
similarity index 100%
rename from src/modules/uavcan/sensors/sensor_bridge.cpp
rename to platforms/nuttx/src/modules/uavcan/sensors/sensor_bridge.cpp
diff --git a/src/modules/uavcan/sensors/sensor_bridge.hpp b/platforms/nuttx/src/modules/uavcan/sensors/sensor_bridge.hpp
similarity index 100%
rename from src/modules/uavcan/sensors/sensor_bridge.hpp
rename to platforms/nuttx/src/modules/uavcan/sensors/sensor_bridge.hpp
diff --git a/src/modules/uavcan/uavcan_main.cpp b/platforms/nuttx/src/modules/uavcan/uavcan_main.cpp
similarity index 100%
rename from src/modules/uavcan/uavcan_main.cpp
rename to platforms/nuttx/src/modules/uavcan/uavcan_main.cpp
diff --git a/src/modules/uavcan/uavcan_main.hpp b/platforms/nuttx/src/modules/uavcan/uavcan_main.hpp
similarity index 100%
rename from src/modules/uavcan/uavcan_main.hpp
rename to platforms/nuttx/src/modules/uavcan/uavcan_main.hpp
diff --git a/src/modules/uavcan/uavcan_module.hpp b/platforms/nuttx/src/modules/uavcan/uavcan_module.hpp
similarity index 100%
rename from src/modules/uavcan/uavcan_module.hpp
rename to platforms/nuttx/src/modules/uavcan/uavcan_module.hpp
diff --git a/src/modules/uavcan/uavcan_params.c b/platforms/nuttx/src/modules/uavcan/uavcan_params.c
similarity index 100%
rename from src/modules/uavcan/uavcan_params.c
rename to platforms/nuttx/src/modules/uavcan/uavcan_params.c
diff --git a/src/modules/uavcan/uavcan_servers.cpp b/platforms/nuttx/src/modules/uavcan/uavcan_servers.cpp
similarity index 100%
rename from src/modules/uavcan/uavcan_servers.cpp
rename to platforms/nuttx/src/modules/uavcan/uavcan_servers.cpp
diff --git a/src/modules/uavcan/uavcan_servers.hpp b/platforms/nuttx/src/modules/uavcan/uavcan_servers.hpp
similarity index 100%
rename from src/modules/uavcan/uavcan_servers.hpp
rename to platforms/nuttx/src/modules/uavcan/uavcan_servers.hpp
diff --git a/src/modules/uavcan/uavcan_virtual_can_driver.hpp b/platforms/nuttx/src/modules/uavcan/uavcan_virtual_can_driver.hpp
similarity index 100%
rename from src/modules/uavcan/uavcan_virtual_can_driver.hpp
rename to platforms/nuttx/src/modules/uavcan/uavcan_virtual_can_driver.hpp
diff --git a/src/modules/uavcanesc/.gitignore b/platforms/nuttx/src/modules/uavcanesc/.gitignore
similarity index 100%
rename from src/modules/uavcanesc/.gitignore
rename to platforms/nuttx/src/modules/uavcanesc/.gitignore
diff --git a/src/modules/uavcanesc/CMakeLists.txt b/platforms/nuttx/src/modules/uavcanesc/CMakeLists.txt
similarity index 100%
rename from src/modules/uavcanesc/CMakeLists.txt
rename to platforms/nuttx/src/modules/uavcanesc/CMakeLists.txt
diff --git a/src/modules/uavcanesc/commands/cfg/CMakeLists.txt b/platforms/nuttx/src/modules/uavcanesc/commands/cfg/CMakeLists.txt
similarity index 100%
rename from src/modules/uavcanesc/commands/cfg/CMakeLists.txt
rename to platforms/nuttx/src/modules/uavcanesc/commands/cfg/CMakeLists.txt
diff --git a/src/modules/uavcanesc/commands/cfg/esc_cfg.cpp b/platforms/nuttx/src/modules/uavcanesc/commands/cfg/esc_cfg.cpp
similarity index 100%
rename from src/modules/uavcanesc/commands/cfg/esc_cfg.cpp
rename to platforms/nuttx/src/modules/uavcanesc/commands/cfg/esc_cfg.cpp
diff --git a/src/modules/uavcanesc/commands/cfg/esc_cfg.hpp b/platforms/nuttx/src/modules/uavcanesc/commands/cfg/esc_cfg.hpp
similarity index 100%
rename from src/modules/uavcanesc/commands/cfg/esc_cfg.hpp
rename to platforms/nuttx/src/modules/uavcanesc/commands/cfg/esc_cfg.hpp
diff --git a/src/modules/uavcanesc/commands/dc/CMakeLists.txt b/platforms/nuttx/src/modules/uavcanesc/commands/dc/CMakeLists.txt
similarity index 100%
rename from src/modules/uavcanesc/commands/dc/CMakeLists.txt
rename to platforms/nuttx/src/modules/uavcanesc/commands/dc/CMakeLists.txt
diff --git a/src/modules/uavcanesc/commands/dc/esc_dc.cpp b/platforms/nuttx/src/modules/uavcanesc/commands/dc/esc_dc.cpp
similarity index 100%
rename from src/modules/uavcanesc/commands/dc/esc_dc.cpp
rename to platforms/nuttx/src/modules/uavcanesc/commands/dc/esc_dc.cpp
diff --git a/src/modules/uavcanesc/commands/dc/esc_dc.hpp b/platforms/nuttx/src/modules/uavcanesc/commands/dc/esc_dc.hpp
similarity index 100%
rename from src/modules/uavcanesc/commands/dc/esc_dc.hpp
rename to platforms/nuttx/src/modules/uavcanesc/commands/dc/esc_dc.hpp
diff --git a/src/modules/uavcanesc/commands/rpm/CMakeLists.txt b/platforms/nuttx/src/modules/uavcanesc/commands/rpm/CMakeLists.txt
similarity index 100%
rename from src/modules/uavcanesc/commands/rpm/CMakeLists.txt
rename to platforms/nuttx/src/modules/uavcanesc/commands/rpm/CMakeLists.txt
diff --git a/src/modules/uavcanesc/commands/rpm/esc_rpm.cpp b/platforms/nuttx/src/modules/uavcanesc/commands/rpm/esc_rpm.cpp
similarity index 100%
rename from src/modules/uavcanesc/commands/rpm/esc_rpm.cpp
rename to platforms/nuttx/src/modules/uavcanesc/commands/rpm/esc_rpm.cpp
diff --git a/src/modules/uavcanesc/commands/rpm/esc_rpm.hpp b/platforms/nuttx/src/modules/uavcanesc/commands/rpm/esc_rpm.hpp
similarity index 100%
rename from src/modules/uavcanesc/commands/rpm/esc_rpm.hpp
rename to platforms/nuttx/src/modules/uavcanesc/commands/rpm/esc_rpm.hpp
diff --git a/src/modules/uavcanesc/commands/selftest/CMakeLists.txt b/platforms/nuttx/src/modules/uavcanesc/commands/selftest/CMakeLists.txt
similarity index 100%
rename from src/modules/uavcanesc/commands/selftest/CMakeLists.txt
rename to platforms/nuttx/src/modules/uavcanesc/commands/selftest/CMakeLists.txt
diff --git a/src/modules/uavcanesc/commands/selftest/esc_selftest.cpp b/platforms/nuttx/src/modules/uavcanesc/commands/selftest/esc_selftest.cpp
similarity index 100%
rename from src/modules/uavcanesc/commands/selftest/esc_selftest.cpp
rename to platforms/nuttx/src/modules/uavcanesc/commands/selftest/esc_selftest.cpp
diff --git a/src/modules/uavcanesc/commands/selftest/esc_selftest.hpp b/platforms/nuttx/src/modules/uavcanesc/commands/selftest/esc_selftest.hpp
similarity index 100%
rename from src/modules/uavcanesc/commands/selftest/esc_selftest.hpp
rename to platforms/nuttx/src/modules/uavcanesc/commands/selftest/esc_selftest.hpp
diff --git a/src/modules/uavcanesc/commands/stat/CMakeLists.txt b/platforms/nuttx/src/modules/uavcanesc/commands/stat/CMakeLists.txt
similarity index 100%
rename from src/modules/uavcanesc/commands/stat/CMakeLists.txt
rename to platforms/nuttx/src/modules/uavcanesc/commands/stat/CMakeLists.txt
diff --git a/src/modules/uavcanesc/commands/stat/esc_stat.cpp b/platforms/nuttx/src/modules/uavcanesc/commands/stat/esc_stat.cpp
similarity index 100%
rename from src/modules/uavcanesc/commands/stat/esc_stat.cpp
rename to platforms/nuttx/src/modules/uavcanesc/commands/stat/esc_stat.cpp
diff --git a/src/modules/uavcanesc/commands/stat/esc_stat.hpp b/platforms/nuttx/src/modules/uavcanesc/commands/stat/esc_stat.hpp
similarity index 100%
rename from src/modules/uavcanesc/commands/stat/esc_stat.hpp
rename to platforms/nuttx/src/modules/uavcanesc/commands/stat/esc_stat.hpp
diff --git a/src/modules/uavcanesc/indication_controller.cpp b/platforms/nuttx/src/modules/uavcanesc/indication_controller.cpp
similarity index 100%
rename from src/modules/uavcanesc/indication_controller.cpp
rename to platforms/nuttx/src/modules/uavcanesc/indication_controller.cpp
diff --git a/src/modules/uavcanesc/indication_controller.hpp b/platforms/nuttx/src/modules/uavcanesc/indication_controller.hpp
similarity index 100%
rename from src/modules/uavcanesc/indication_controller.hpp
rename to platforms/nuttx/src/modules/uavcanesc/indication_controller.hpp
diff --git a/src/modules/uavcanesc/led.cpp b/platforms/nuttx/src/modules/uavcanesc/led.cpp
similarity index 100%
rename from src/modules/uavcanesc/led.cpp
rename to platforms/nuttx/src/modules/uavcanesc/led.cpp
diff --git a/src/modules/uavcanesc/led.hpp b/platforms/nuttx/src/modules/uavcanesc/led.hpp
similarity index 100%
rename from src/modules/uavcanesc/led.hpp
rename to platforms/nuttx/src/modules/uavcanesc/led.hpp
diff --git a/src/modules/uavcanesc/nshterm/CMakeLists.txt b/platforms/nuttx/src/modules/uavcanesc/nshterm/CMakeLists.txt
similarity index 100%
rename from src/modules/uavcanesc/nshterm/CMakeLists.txt
rename to platforms/nuttx/src/modules/uavcanesc/nshterm/CMakeLists.txt
diff --git a/src/modules/uavcanesc/nshterm/nshterm.c b/platforms/nuttx/src/modules/uavcanesc/nshterm/nshterm.c
similarity index 100%
rename from src/modules/uavcanesc/nshterm/nshterm.c
rename to platforms/nuttx/src/modules/uavcanesc/nshterm/nshterm.c
diff --git a/src/modules/uavcanesc/uavcanesc_main.cpp b/platforms/nuttx/src/modules/uavcanesc/uavcanesc_main.cpp
similarity index 100%
rename from src/modules/uavcanesc/uavcanesc_main.cpp
rename to platforms/nuttx/src/modules/uavcanesc/uavcanesc_main.cpp
diff --git a/src/modules/uavcanesc/uavcanesc_main.hpp b/platforms/nuttx/src/modules/uavcanesc/uavcanesc_main.hpp
similarity index 100%
rename from src/modules/uavcanesc/uavcanesc_main.hpp
rename to platforms/nuttx/src/modules/uavcanesc/uavcanesc_main.hpp
diff --git a/src/modules/uavcanesc/uavcanesc_params.c b/platforms/nuttx/src/modules/uavcanesc/uavcanesc_params.c
similarity index 100%
rename from src/modules/uavcanesc/uavcanesc_params.c
rename to platforms/nuttx/src/modules/uavcanesc/uavcanesc_params.c
diff --git a/src/modules/uavcannode/.gitignore b/platforms/nuttx/src/modules/uavcannode/.gitignore
similarity index 100%
rename from src/modules/uavcannode/.gitignore
rename to platforms/nuttx/src/modules/uavcannode/.gitignore
diff --git a/src/modules/uavcannode/CMakeLists.txt b/platforms/nuttx/src/modules/uavcannode/CMakeLists.txt
similarity index 100%
rename from src/modules/uavcannode/CMakeLists.txt
rename to platforms/nuttx/src/modules/uavcannode/CMakeLists.txt
diff --git a/src/modules/uavcannode/indication_controller.cpp b/platforms/nuttx/src/modules/uavcannode/indication_controller.cpp
similarity index 100%
rename from src/modules/uavcannode/indication_controller.cpp
rename to platforms/nuttx/src/modules/uavcannode/indication_controller.cpp
diff --git a/src/modules/uavcannode/indication_controller.hpp b/platforms/nuttx/src/modules/uavcannode/indication_controller.hpp
similarity index 100%
rename from src/modules/uavcannode/indication_controller.hpp
rename to platforms/nuttx/src/modules/uavcannode/indication_controller.hpp
diff --git a/src/modules/uavcannode/led.cpp b/platforms/nuttx/src/modules/uavcannode/led.cpp
similarity index 100%
rename from src/modules/uavcannode/led.cpp
rename to platforms/nuttx/src/modules/uavcannode/led.cpp
diff --git a/src/modules/uavcannode/led.hpp b/platforms/nuttx/src/modules/uavcannode/led.hpp
similarity index 100%
rename from src/modules/uavcannode/led.hpp
rename to platforms/nuttx/src/modules/uavcannode/led.hpp
diff --git a/src/modules/uavcannode/resources.cpp b/platforms/nuttx/src/modules/uavcannode/resources.cpp
similarity index 100%
rename from src/modules/uavcannode/resources.cpp
rename to platforms/nuttx/src/modules/uavcannode/resources.cpp
diff --git a/src/modules/uavcannode/resources.hpp b/platforms/nuttx/src/modules/uavcannode/resources.hpp
similarity index 100%
rename from src/modules/uavcannode/resources.hpp
rename to platforms/nuttx/src/modules/uavcannode/resources.hpp
diff --git a/src/modules/uavcannode/sim_controller.cpp b/platforms/nuttx/src/modules/uavcannode/sim_controller.cpp
similarity index 100%
rename from src/modules/uavcannode/sim_controller.cpp
rename to platforms/nuttx/src/modules/uavcannode/sim_controller.cpp
diff --git a/src/modules/uavcannode/sim_controller.hpp b/platforms/nuttx/src/modules/uavcannode/sim_controller.hpp
similarity index 100%
rename from src/modules/uavcannode/sim_controller.hpp
rename to platforms/nuttx/src/modules/uavcannode/sim_controller.hpp
diff --git a/src/modules/uavcannode/uavcannode_main.cpp b/platforms/nuttx/src/modules/uavcannode/uavcannode_main.cpp
similarity index 100%
rename from src/modules/uavcannode/uavcannode_main.cpp
rename to platforms/nuttx/src/modules/uavcannode/uavcannode_main.cpp
diff --git a/src/modules/uavcannode/uavcannode_main.hpp b/platforms/nuttx/src/modules/uavcannode/uavcannode_main.hpp
similarity index 100%
rename from src/modules/uavcannode/uavcannode_main.hpp
rename to platforms/nuttx/src/modules/uavcannode/uavcannode_main.hpp
diff --git a/src/modules/uavcannode/uavcannode_params.c b/platforms/nuttx/src/modules/uavcannode/uavcannode_params.c
similarity index 100%
rename from src/modules/uavcannode/uavcannode_params.c
rename to platforms/nuttx/src/modules/uavcannode/uavcannode_params.c
diff --git a/src/platforms/nuttx/CMakeLists.txt b/platforms/nuttx/src/platforms/nuttx/CMakeLists.txt
similarity index 100%
rename from src/platforms/nuttx/CMakeLists.txt
rename to platforms/nuttx/src/platforms/nuttx/CMakeLists.txt
diff --git a/src/platforms/nuttx/px4_layer/CMakeLists.txt b/platforms/nuttx/src/platforms/nuttx/px4_layer/CMakeLists.txt
similarity index 96%
rename from src/platforms/nuttx/px4_layer/CMakeLists.txt
rename to platforms/nuttx/src/platforms/nuttx/px4_layer/CMakeLists.txt
index fd11e6e598c6..0de5caa59352 100644
--- a/src/platforms/nuttx/px4_layer/CMakeLists.txt
+++ b/platforms/nuttx/src/platforms/nuttx/px4_layer/CMakeLists.txt
@@ -35,7 +35,7 @@ px4_add_module(
COMPILE_FLAGS
SRCS
px4_nuttx_tasks.c
- ../../posix/px4_layer/px4_log.c
+ ${PX4_SOURCE_DIR}/src/platforms/posix/px4_layer/px4_log.c
DEPENDS
platforms__common
)
diff --git a/src/platforms/nuttx/px4_layer/px4_nuttx_tasks.c b/platforms/nuttx/src/platforms/nuttx/px4_layer/px4_nuttx_tasks.c
similarity index 100%
rename from src/platforms/nuttx/px4_layer/px4_nuttx_tasks.c
rename to platforms/nuttx/src/platforms/nuttx/px4_layer/px4_nuttx_tasks.c
diff --git a/src/platforms/nuttx/px4_nuttx_impl.cpp b/platforms/nuttx/src/platforms/nuttx/px4_nuttx_impl.cpp
similarity index 100%
rename from src/platforms/nuttx/px4_nuttx_impl.cpp
rename to platforms/nuttx/src/platforms/nuttx/px4_nuttx_impl.cpp
diff --git a/src/systemcmds/bl_update/CMakeLists.txt b/platforms/nuttx/src/systemcmds/bl_update/CMakeLists.txt
similarity index 100%
rename from src/systemcmds/bl_update/CMakeLists.txt
rename to platforms/nuttx/src/systemcmds/bl_update/CMakeLists.txt
diff --git a/src/systemcmds/bl_update/bl_update.c b/platforms/nuttx/src/systemcmds/bl_update/bl_update.c
similarity index 100%
rename from src/systemcmds/bl_update/bl_update.c
rename to platforms/nuttx/src/systemcmds/bl_update/bl_update.c
diff --git a/src/systemcmds/hardfault_log/CMakeLists.txt b/platforms/nuttx/src/systemcmds/hardfault_log/CMakeLists.txt
similarity index 100%
rename from src/systemcmds/hardfault_log/CMakeLists.txt
rename to platforms/nuttx/src/systemcmds/hardfault_log/CMakeLists.txt
diff --git a/src/systemcmds/hardfault_log/hardfault_log.c b/platforms/nuttx/src/systemcmds/hardfault_log/hardfault_log.c
similarity index 100%
rename from src/systemcmds/hardfault_log/hardfault_log.c
rename to platforms/nuttx/src/systemcmds/hardfault_log/hardfault_log.c
diff --git a/src/systemcmds/i2c/CMakeLists.txt b/platforms/nuttx/src/systemcmds/i2c/CMakeLists.txt
similarity index 100%
rename from src/systemcmds/i2c/CMakeLists.txt
rename to platforms/nuttx/src/systemcmds/i2c/CMakeLists.txt
diff --git a/src/systemcmds/i2c/i2c.c b/platforms/nuttx/src/systemcmds/i2c/i2c.c
similarity index 100%
rename from src/systemcmds/i2c/i2c.c
rename to platforms/nuttx/src/systemcmds/i2c/i2c.c
diff --git a/src/systemcmds/motor_test/CMakeLists.txt b/platforms/nuttx/src/systemcmds/motor_test/CMakeLists.txt
similarity index 100%
rename from src/systemcmds/motor_test/CMakeLists.txt
rename to platforms/nuttx/src/systemcmds/motor_test/CMakeLists.txt
diff --git a/src/systemcmds/motor_test/motor_test.c b/platforms/nuttx/src/systemcmds/motor_test/motor_test.c
similarity index 100%
rename from src/systemcmds/motor_test/motor_test.c
rename to platforms/nuttx/src/systemcmds/motor_test/motor_test.c
diff --git a/src/systemcmds/mtd/24xxxx_mtd.c b/platforms/nuttx/src/systemcmds/mtd/24xxxx_mtd.c
similarity index 100%
rename from src/systemcmds/mtd/24xxxx_mtd.c
rename to platforms/nuttx/src/systemcmds/mtd/24xxxx_mtd.c
diff --git a/src/systemcmds/mtd/CMakeLists.txt b/platforms/nuttx/src/systemcmds/mtd/CMakeLists.txt
similarity index 100%
rename from src/systemcmds/mtd/CMakeLists.txt
rename to platforms/nuttx/src/systemcmds/mtd/CMakeLists.txt
diff --git a/src/systemcmds/mtd/mtd.c b/platforms/nuttx/src/systemcmds/mtd/mtd.c
similarity index 100%
rename from src/systemcmds/mtd/mtd.c
rename to platforms/nuttx/src/systemcmds/mtd/mtd.c
diff --git a/src/systemcmds/nshterm/CMakeLists.txt b/platforms/nuttx/src/systemcmds/nshterm/CMakeLists.txt
similarity index 100%
rename from src/systemcmds/nshterm/CMakeLists.txt
rename to platforms/nuttx/src/systemcmds/nshterm/CMakeLists.txt
diff --git a/src/systemcmds/nshterm/nshterm.c b/platforms/nuttx/src/systemcmds/nshterm/nshterm.c
similarity index 100%
rename from src/systemcmds/nshterm/nshterm.c
rename to platforms/nuttx/src/systemcmds/nshterm/nshterm.c
diff --git a/src/drivers/boards/bebop/board_config.h b/platforms/posix/boards/bebop/board_config.h
similarity index 98%
rename from src/drivers/boards/bebop/board_config.h
rename to platforms/posix/boards/bebop/board_config.h
index d91ab0ef5a45..a90b06e7090e 100644
--- a/src/drivers/boards/bebop/board_config.h
+++ b/platforms/posix/boards/bebop/board_config.h
@@ -49,4 +49,4 @@
#define BOARD_HAS_NO_BOOTLOADER
#include
-#include "../common/board_common.h"
+#include "common/board_common.h"
diff --git a/cmake/configs/posix_bebop_default.cmake b/platforms/posix/boards/bebop/config_default.cmake
similarity index 100%
rename from cmake/configs/posix_bebop_default.cmake
rename to platforms/posix/boards/bebop/config_default.cmake
diff --git a/src/drivers/boards/ocpoc/board_config.h b/platforms/posix/boards/ocpoc/board_config.h
similarity index 98%
rename from src/drivers/boards/ocpoc/board_config.h
rename to platforms/posix/boards/ocpoc/board_config.h
index c22b6191c733..e4024bb037b2 100644
--- a/src/drivers/boards/ocpoc/board_config.h
+++ b/platforms/posix/boards/ocpoc/board_config.h
@@ -53,6 +53,6 @@
#define ADC_AIRSPEED_VOLTAGE_CHANNEL 11
#include
-#include "../common/board_common.h"
+#include "common/board_common.h"
#define BOARD_MAX_LEDS 1 // Number external of LED's this board has
diff --git a/cmake/configs/posix_ocpoc_cross.cmake b/platforms/posix/boards/ocpoc/config_cross.cmake
similarity index 100%
rename from cmake/configs/posix_ocpoc_cross.cmake
rename to platforms/posix/boards/ocpoc/config_cross.cmake
diff --git a/cmake/configs/posix_ocpoc_ubuntu.cmake b/platforms/posix/boards/ocpoc/config_ubuntu.cmake
similarity index 100%
rename from cmake/configs/posix_ocpoc_ubuntu.cmake
rename to platforms/posix/boards/ocpoc/config_ubuntu.cmake
diff --git a/src/drivers/boards/rpi/board_config.h b/platforms/posix/boards/rpi/board_config.h
similarity index 98%
rename from src/drivers/boards/rpi/board_config.h
rename to platforms/posix/boards/rpi/board_config.h
index a6b5c33914f2..32cd269ab390 100644
--- a/src/drivers/boards/rpi/board_config.h
+++ b/platforms/posix/boards/rpi/board_config.h
@@ -51,4 +51,4 @@
#define BOARD_MAX_LEDS 1 // Number external of LED's this board has
#include
-#include "../common/board_common.h"
+#include "common/board_common.h"
diff --git a/cmake/configs/posix_rpi_common.cmake b/platforms/posix/boards/rpi/config_common.cmake
similarity index 100%
rename from cmake/configs/posix_rpi_common.cmake
rename to platforms/posix/boards/rpi/config_common.cmake
diff --git a/cmake/configs/posix_rpi_cross_no_shield.cmake b/platforms/posix/boards/rpi/config_cross
similarity index 100%
rename from cmake/configs/posix_rpi_cross_no_shield.cmake
rename to platforms/posix/boards/rpi/config_cross
diff --git a/cmake/configs/posix_rpi_cross.cmake b/platforms/posix/boards/rpi/config_cross.cmake
similarity index 100%
rename from cmake/configs/posix_rpi_cross.cmake
rename to platforms/posix/boards/rpi/config_cross.cmake
diff --git a/cmake/configs/posix_rpi_native.cmake b/platforms/posix/boards/rpi/config_native.cmake
similarity index 100%
rename from cmake/configs/posix_rpi_native.cmake
rename to platforms/posix/boards/rpi/config_native.cmake
diff --git a/src/drivers/boards/sitl/board_config.h b/platforms/posix/boards/sitl/board_config.h
similarity index 98%
rename from src/drivers/boards/sitl/board_config.h
rename to platforms/posix/boards/sitl/board_config.h
index ac0f16198d7b..0fc07aff7baf 100644
--- a/src/drivers/boards/sitl/board_config.h
+++ b/platforms/posix/boards/sitl/board_config.h
@@ -51,4 +51,4 @@
#define CONFIG_ARCH_BOARD_SITL 1
#include
-#include "../common/board_common.h"
+#include "common/board_common.h"
diff --git a/platforms/posix/boards/sitl/config_broadcast.cmake b/platforms/posix/boards/sitl/config_broadcast.cmake
new file mode 100644
index 000000000000..cce415ffac33
--- /dev/null
+++ b/platforms/posix/boards/sitl/config_broadcast.cmake
@@ -0,0 +1,3 @@
+include(platforms/posix/cmake/configs/posix_sitl_default.cmake)
+
+# This config is just the same as posix_sitl_default.
diff --git a/cmake/configs/posix_sitl_default.cmake b/platforms/posix/boards/sitl/config_default.cmake
similarity index 98%
rename from cmake/configs/posix_sitl_default.cmake
rename to platforms/posix/boards/sitl/config_default.cmake
index ee8248967456..dfa0a0653fe7 100644
--- a/cmake/configs/posix_sitl_default.cmake
+++ b/platforms/posix/boards/sitl/config_default.cmake
@@ -196,7 +196,7 @@ set(config_rtps_receive_topics
# for the config posix_sitl_efk2 and set again, explicitly, for posix_sitl_lpe,
# which are based on posix_sitl_default.
set(config_sitl_rcS_dir
- posix-configs/SITL/init/ekf2
+ platforms/posix/posix-configs/SITL/init/ekf2
CACHE INTERNAL "init script dir for sitl"
)
diff --git a/platforms/posix/boards/sitl/config_ekf2.cmake b/platforms/posix/boards/sitl/config_ekf2.cmake
new file mode 100644
index 000000000000..a40f0d4a3fb8
--- /dev/null
+++ b/platforms/posix/boards/sitl/config_ekf2.cmake
@@ -0,0 +1,5 @@
+include(platforms/posix/cmake/configs/posix_sitl_default.cmake)
+
+set(config_sitl_rcS_dir
+ platforms/posix/posix-configs/SITL/init/ekf2
+ )
diff --git a/platforms/posix/boards/sitl/config_inav.cmake b/platforms/posix/boards/sitl/config_inav.cmake
new file mode 100644
index 000000000000..09b9c71200cb
--- /dev/null
+++ b/platforms/posix/boards/sitl/config_inav.cmake
@@ -0,0 +1,5 @@
+include(platforms/posix/cmake/configs/posix_sitl_default.cmake)
+
+set(config_sitl_rcS_dir
+ platforms/posix/posix-configs/SITL/init/inav
+ )
diff --git a/platforms/posix/boards/sitl/config_lpe.cmake b/platforms/posix/boards/sitl/config_lpe.cmake
new file mode 100644
index 000000000000..2683b24a53e9
--- /dev/null
+++ b/platforms/posix/boards/sitl/config_lpe.cmake
@@ -0,0 +1,6 @@
+include(platforms/posix/cmake/configs/posix_sitl_default.cmake)
+
+# This is already the default, but lets explicitly set it again to lpe.
+set(config_sitl_rcS_dir
+ platforms/posix/posix-configs/SITL/init/lpe
+ )
diff --git a/cmake/configs/posix_sitl_replay.cmake b/platforms/posix/boards/sitl/config_replay.cmake
similarity index 95%
rename from cmake/configs/posix_sitl_replay.cmake
rename to platforms/posix/boards/sitl/config_replay.cmake
index 1ee9b97f01c4..9087a3eb6fbd 100644
--- a/cmake/configs/posix_sitl_replay.cmake
+++ b/platforms/posix/boards/sitl/config_replay.cmake
@@ -37,7 +37,7 @@ set(config_extra_builtin_cmds
)
set(config_sitl_rcS_dir
- posix-configs/SITL/init/replay
+ platforms/posix/posix-configs/SITL/init/replay
CACHE INTERNAL "init script dir for sitl"
)
diff --git a/platforms/posix/boards/sitl/config_shell.cmake b/platforms/posix/boards/sitl/config_shell.cmake
new file mode 100644
index 000000000000..e896575ed2fa
--- /dev/null
+++ b/platforms/posix/boards/sitl/config_shell.cmake
@@ -0,0 +1,5 @@
+include(platforms/posix/cmake/configs/posix_sitl_default.cmake)
+
+set(config_sitl_rcS_dir
+ platforms/posix/posix-configs/SITL/init/shell
+ )
diff --git a/platforms/posix/boards/sitl/config_test.cmake b/platforms/posix/boards/sitl/config_test.cmake
new file mode 100644
index 000000000000..9098a445bf6b
--- /dev/null
+++ b/platforms/posix/boards/sitl/config_test.cmake
@@ -0,0 +1,5 @@
+include(platforms/posix/cmake/configs/posix_sitl_default.cmake)
+
+set(config_sitl_rcS_dir
+ platforms/posix/posix-configs/SITL/init/test
+ )
diff --git a/cmake/posix/ld.script b/platforms/posix/cmake/posix/ld.script
similarity index 100%
rename from cmake/posix/ld.script
rename to platforms/posix/cmake/posix/ld.script
diff --git a/cmake/posix/px4_impl_posix.cmake b/platforms/posix/cmake/posix/px4_impl_posix.cmake
similarity index 100%
rename from cmake/posix/px4_impl_posix.cmake
rename to platforms/posix/cmake/posix/px4_impl_posix.cmake
diff --git a/posix-configs/SITL/README.md b/platforms/posix/posix-configs/SITL/README.md
similarity index 100%
rename from posix-configs/SITL/README.md
rename to platforms/posix/posix-configs/SITL/README.md
diff --git a/posix-configs/SITL/SITL_Diagram.png b/platforms/posix/posix-configs/SITL/SITL_Diagram.png
similarity index 100%
rename from posix-configs/SITL/SITL_Diagram.png
rename to platforms/posix/posix-configs/SITL/SITL_Diagram.png
diff --git a/posix-configs/SITL/init/ekf2/iris b/platforms/posix/posix-configs/SITL/init/ekf2/iris
similarity index 100%
rename from posix-configs/SITL/init/ekf2/iris
rename to platforms/posix/posix-configs/SITL/init/ekf2/iris
diff --git a/posix-configs/SITL/init/ekf2/iris_1 b/platforms/posix/posix-configs/SITL/init/ekf2/iris_1
similarity index 100%
rename from posix-configs/SITL/init/ekf2/iris_1
rename to platforms/posix/posix-configs/SITL/init/ekf2/iris_1
diff --git a/posix-configs/SITL/init/ekf2/iris_2 b/platforms/posix/posix-configs/SITL/init/ekf2/iris_2
similarity index 100%
rename from posix-configs/SITL/init/ekf2/iris_2
rename to platforms/posix/posix-configs/SITL/init/ekf2/iris_2
diff --git a/posix-configs/SITL/init/ekf2/iris_opt_flow b/platforms/posix/posix-configs/SITL/init/ekf2/iris_opt_flow
similarity index 100%
rename from posix-configs/SITL/init/ekf2/iris_opt_flow
rename to platforms/posix/posix-configs/SITL/init/ekf2/iris_opt_flow
diff --git a/posix-configs/SITL/init/ekf2/iris_replay b/platforms/posix/posix-configs/SITL/init/ekf2/iris_replay
similarity index 100%
rename from posix-configs/SITL/init/ekf2/iris_replay
rename to platforms/posix/posix-configs/SITL/init/ekf2/iris_replay
diff --git a/posix-configs/SITL/init/ekf2/iris_rplidar b/platforms/posix/posix-configs/SITL/init/ekf2/iris_rplidar
similarity index 100%
rename from posix-configs/SITL/init/ekf2/iris_rplidar
rename to platforms/posix/posix-configs/SITL/init/ekf2/iris_rplidar
diff --git a/posix-configs/SITL/init/ekf2/multiple_iris b/platforms/posix/posix-configs/SITL/init/ekf2/multiple_iris
similarity index 100%
rename from posix-configs/SITL/init/ekf2/multiple_iris
rename to platforms/posix/posix-configs/SITL/init/ekf2/multiple_iris
diff --git a/posix-configs/SITL/init/ekf2/plane b/platforms/posix/posix-configs/SITL/init/ekf2/plane
similarity index 100%
rename from posix-configs/SITL/init/ekf2/plane
rename to platforms/posix/posix-configs/SITL/init/ekf2/plane
diff --git a/posix-configs/SITL/init/ekf2/rover b/platforms/posix/posix-configs/SITL/init/ekf2/rover
similarity index 100%
rename from posix-configs/SITL/init/ekf2/rover
rename to platforms/posix/posix-configs/SITL/init/ekf2/rover
diff --git a/posix-configs/SITL/init/ekf2/solo b/platforms/posix/posix-configs/SITL/init/ekf2/solo
similarity index 100%
rename from posix-configs/SITL/init/ekf2/solo
rename to platforms/posix/posix-configs/SITL/init/ekf2/solo
diff --git a/posix-configs/SITL/init/ekf2/standard_vtol b/platforms/posix/posix-configs/SITL/init/ekf2/standard_vtol
similarity index 100%
rename from posix-configs/SITL/init/ekf2/standard_vtol
rename to platforms/posix/posix-configs/SITL/init/ekf2/standard_vtol
diff --git a/posix-configs/SITL/init/ekf2/tailsitter b/platforms/posix/posix-configs/SITL/init/ekf2/tailsitter
similarity index 100%
rename from posix-configs/SITL/init/ekf2/tailsitter
rename to platforms/posix/posix-configs/SITL/init/ekf2/tailsitter
diff --git a/posix-configs/SITL/init/ekf2/typhoon_h480 b/platforms/posix/posix-configs/SITL/init/ekf2/typhoon_h480
similarity index 100%
rename from posix-configs/SITL/init/ekf2/typhoon_h480
rename to platforms/posix/posix-configs/SITL/init/ekf2/typhoon_h480
diff --git a/posix-configs/SITL/init/inav/iris b/platforms/posix/posix-configs/SITL/init/inav/iris
similarity index 100%
rename from posix-configs/SITL/init/inav/iris
rename to platforms/posix/posix-configs/SITL/init/inav/iris
diff --git a/posix-configs/SITL/init/inav/iris_opt_flow b/platforms/posix/posix-configs/SITL/init/inav/iris_opt_flow
similarity index 100%
rename from posix-configs/SITL/init/inav/iris_opt_flow
rename to platforms/posix/posix-configs/SITL/init/inav/iris_opt_flow
diff --git a/posix-configs/SITL/init/lpe/iris b/platforms/posix/posix-configs/SITL/init/lpe/iris
similarity index 100%
rename from posix-configs/SITL/init/lpe/iris
rename to platforms/posix/posix-configs/SITL/init/lpe/iris
diff --git a/posix-configs/SITL/init/lpe/iris_1 b/platforms/posix/posix-configs/SITL/init/lpe/iris_1
similarity index 100%
rename from posix-configs/SITL/init/lpe/iris_1
rename to platforms/posix/posix-configs/SITL/init/lpe/iris_1
diff --git a/posix-configs/SITL/init/lpe/iris_2 b/platforms/posix/posix-configs/SITL/init/lpe/iris_2
similarity index 100%
rename from posix-configs/SITL/init/lpe/iris_2
rename to platforms/posix/posix-configs/SITL/init/lpe/iris_2
diff --git a/posix-configs/SITL/init/lpe/iris_opt_flow b/platforms/posix/posix-configs/SITL/init/lpe/iris_opt_flow
similarity index 100%
rename from posix-configs/SITL/init/lpe/iris_opt_flow
rename to platforms/posix/posix-configs/SITL/init/lpe/iris_opt_flow
diff --git a/posix-configs/SITL/init/lpe/iris_rplidar b/platforms/posix/posix-configs/SITL/init/lpe/iris_rplidar
similarity index 100%
rename from posix-configs/SITL/init/lpe/iris_rplidar
rename to platforms/posix/posix-configs/SITL/init/lpe/iris_rplidar
diff --git a/posix-configs/SITL/init/lpe/plane b/platforms/posix/posix-configs/SITL/init/lpe/plane
similarity index 100%
rename from posix-configs/SITL/init/lpe/plane
rename to platforms/posix/posix-configs/SITL/init/lpe/plane
diff --git a/posix-configs/SITL/init/lpe/rover b/platforms/posix/posix-configs/SITL/init/lpe/rover
similarity index 100%
rename from posix-configs/SITL/init/lpe/rover
rename to platforms/posix/posix-configs/SITL/init/lpe/rover
diff --git a/posix-configs/SITL/init/lpe/solo b/platforms/posix/posix-configs/SITL/init/lpe/solo
similarity index 100%
rename from posix-configs/SITL/init/lpe/solo
rename to platforms/posix/posix-configs/SITL/init/lpe/solo
diff --git a/posix-configs/SITL/init/lpe/standard_vtol b/platforms/posix/posix-configs/SITL/init/lpe/standard_vtol
similarity index 100%
rename from posix-configs/SITL/init/lpe/standard_vtol
rename to platforms/posix/posix-configs/SITL/init/lpe/standard_vtol
diff --git a/posix-configs/SITL/init/lpe/typhoon_h480 b/platforms/posix/posix-configs/SITL/init/lpe/typhoon_h480
similarity index 100%
rename from posix-configs/SITL/init/lpe/typhoon_h480
rename to platforms/posix/posix-configs/SITL/init/lpe/typhoon_h480
diff --git a/posix-configs/SITL/init/rcS_gazebo_delta_wing b/platforms/posix/posix-configs/SITL/init/rcS_gazebo_delta_wing
similarity index 100%
rename from posix-configs/SITL/init/rcS_gazebo_delta_wing
rename to platforms/posix/posix-configs/SITL/init/rcS_gazebo_delta_wing
diff --git a/posix-configs/SITL/init/replay/iris b/platforms/posix/posix-configs/SITL/init/replay/iris
similarity index 100%
rename from posix-configs/SITL/init/replay/iris
rename to platforms/posix/posix-configs/SITL/init/replay/iris
diff --git a/posix-configs/SITL/init/shell/iris b/platforms/posix/posix-configs/SITL/init/shell/iris
similarity index 100%
rename from posix-configs/SITL/init/shell/iris
rename to platforms/posix/posix-configs/SITL/init/shell/iris
diff --git a/posix-configs/SITL/init/test/test_template.in b/platforms/posix/posix-configs/SITL/init/test/test_template.in
similarity index 100%
rename from posix-configs/SITL/init/test/test_template.in
rename to platforms/posix/posix-configs/SITL/init/test/test_template.in
diff --git a/posix-configs/SITL/init/test/tests_all b/platforms/posix/posix-configs/SITL/init/test/tests_all
similarity index 100%
rename from posix-configs/SITL/init/test/tests_all
rename to platforms/posix/posix-configs/SITL/init/test/tests_all
diff --git a/posix-configs/bebop/px4.config b/platforms/posix/posix-configs/bebop/px4.config
similarity index 100%
rename from posix-configs/bebop/px4.config
rename to platforms/posix/posix-configs/bebop/px4.config
diff --git a/posix-configs/eagle/200qx/mainapp.config b/platforms/posix/posix-configs/eagle/200qx/mainapp.config
similarity index 100%
rename from posix-configs/eagle/200qx/mainapp.config
rename to platforms/posix/posix-configs/eagle/200qx/mainapp.config
diff --git a/posix-configs/eagle/200qx/px4.config b/platforms/posix/posix-configs/eagle/200qx/px4.config
similarity index 100%
rename from posix-configs/eagle/200qx/px4.config
rename to platforms/posix/posix-configs/eagle/200qx/px4.config
diff --git a/posix-configs/eagle/210qc/mainapp.config b/platforms/posix/posix-configs/eagle/210qc/mainapp.config
similarity index 100%
rename from posix-configs/eagle/210qc/mainapp.config
rename to platforms/posix/posix-configs/eagle/210qc/mainapp.config
diff --git a/posix-configs/eagle/210qc/px4.config b/platforms/posix/posix-configs/eagle/210qc/px4.config
similarity index 100%
rename from posix-configs/eagle/210qc/px4.config
rename to platforms/posix/posix-configs/eagle/210qc/px4.config
diff --git a/posix-configs/eagle/flight/mainapp.config b/platforms/posix/posix-configs/eagle/flight/mainapp.config
similarity index 100%
rename from posix-configs/eagle/flight/mainapp.config
rename to platforms/posix/posix-configs/eagle/flight/mainapp.config
diff --git a/posix-configs/eagle/flight/px4.config b/platforms/posix/posix-configs/eagle/flight/px4.config
similarity index 100%
rename from posix-configs/eagle/flight/px4.config
rename to platforms/posix/posix-configs/eagle/flight/px4.config
diff --git a/posix-configs/eagle/hil/mainapphil.config b/platforms/posix/posix-configs/eagle/hil/mainapphil.config
similarity index 100%
rename from posix-configs/eagle/hil/mainapphil.config
rename to platforms/posix/posix-configs/eagle/hil/mainapphil.config
diff --git a/posix-configs/eagle/hil/px4.config b/platforms/posix/posix-configs/eagle/hil/px4.config
similarity index 100%
rename from posix-configs/eagle/hil/px4.config
rename to platforms/posix/posix-configs/eagle/hil/px4.config
diff --git a/posix-configs/excelsior/mainapp.config b/platforms/posix/posix-configs/excelsior/mainapp.config
similarity index 100%
rename from posix-configs/excelsior/mainapp.config
rename to platforms/posix/posix-configs/excelsior/mainapp.config
diff --git a/posix-configs/excelsior/px4.config b/platforms/posix/posix-configs/excelsior/px4.config
similarity index 100%
rename from posix-configs/excelsior/px4.config
rename to platforms/posix/posix-configs/excelsior/px4.config
diff --git a/posix-configs/ocpoc/px4.config b/platforms/posix/posix-configs/ocpoc/px4.config
similarity index 100%
rename from posix-configs/ocpoc/px4.config
rename to platforms/posix/posix-configs/ocpoc/px4.config
diff --git a/posix-configs/rpi/px4.config b/platforms/posix/posix-configs/rpi/px4.config
similarity index 100%
rename from posix-configs/rpi/px4.config
rename to platforms/posix/posix-configs/rpi/px4.config
diff --git a/posix-configs/rpi/px4_fw.config b/platforms/posix/posix-configs/rpi/px4_fw.config
similarity index 100%
rename from posix-configs/rpi/px4_fw.config
rename to platforms/posix/posix-configs/rpi/px4_fw.config
diff --git a/posix-configs/rpi/px4_hil.config b/platforms/posix/posix-configs/rpi/px4_hil.config
similarity index 100%
rename from posix-configs/rpi/px4_hil.config
rename to platforms/posix/posix-configs/rpi/px4_hil.config
diff --git a/posix-configs/rpi/px4_no_shield.config b/platforms/posix/posix-configs/rpi/px4_no_shield.config
similarity index 100%
rename from posix-configs/rpi/px4_no_shield.config
rename to platforms/posix/posix-configs/rpi/px4_no_shield.config
diff --git a/src/drivers/boards/sim/board_config.h b/platforms/posix/src/drivers/boards/sim/board_config.h
similarity index 100%
rename from src/drivers/boards/sim/board_config.h
rename to platforms/posix/src/drivers/boards/sim/board_config.h
diff --git a/src/drivers/boards/sitl/CMakeLists.txt b/platforms/posix/src/drivers/boards/sitl/CMakeLists.txt
similarity index 100%
rename from src/drivers/boards/sitl/CMakeLists.txt
rename to platforms/posix/src/drivers/boards/sitl/CMakeLists.txt
diff --git a/src/drivers/boards/sitl/sitl_led.c b/platforms/posix/src/drivers/boards/sitl/sitl_led.c
similarity index 100%
rename from src/drivers/boards/sitl/sitl_led.c
rename to platforms/posix/src/drivers/boards/sitl/sitl_led.c
diff --git a/src/drivers/linux_pwm_out/CMakeLists.txt b/platforms/posix/src/drivers/linux_pwm_out/CMakeLists.txt
similarity index 100%
rename from src/drivers/linux_pwm_out/CMakeLists.txt
rename to platforms/posix/src/drivers/linux_pwm_out/CMakeLists.txt
diff --git a/src/drivers/linux_pwm_out/PCA9685.cpp b/platforms/posix/src/drivers/linux_pwm_out/PCA9685.cpp
similarity index 100%
rename from src/drivers/linux_pwm_out/PCA9685.cpp
rename to platforms/posix/src/drivers/linux_pwm_out/PCA9685.cpp
diff --git a/src/drivers/linux_pwm_out/PCA9685.h b/platforms/posix/src/drivers/linux_pwm_out/PCA9685.h
similarity index 100%
rename from src/drivers/linux_pwm_out/PCA9685.h
rename to platforms/posix/src/drivers/linux_pwm_out/PCA9685.h
diff --git a/src/drivers/linux_pwm_out/common.h b/platforms/posix/src/drivers/linux_pwm_out/common.h
similarity index 100%
rename from src/drivers/linux_pwm_out/common.h
rename to platforms/posix/src/drivers/linux_pwm_out/common.h
diff --git a/src/drivers/linux_pwm_out/linux_pwm_out.cpp b/platforms/posix/src/drivers/linux_pwm_out/linux_pwm_out.cpp
similarity index 100%
rename from src/drivers/linux_pwm_out/linux_pwm_out.cpp
rename to platforms/posix/src/drivers/linux_pwm_out/linux_pwm_out.cpp
diff --git a/src/drivers/linux_pwm_out/navio_sysfs.cpp b/platforms/posix/src/drivers/linux_pwm_out/navio_sysfs.cpp
similarity index 100%
rename from src/drivers/linux_pwm_out/navio_sysfs.cpp
rename to platforms/posix/src/drivers/linux_pwm_out/navio_sysfs.cpp
diff --git a/src/drivers/linux_pwm_out/navio_sysfs.h b/platforms/posix/src/drivers/linux_pwm_out/navio_sysfs.h
similarity index 100%
rename from src/drivers/linux_pwm_out/navio_sysfs.h
rename to platforms/posix/src/drivers/linux_pwm_out/navio_sysfs.h
diff --git a/src/drivers/linux_pwm_out/ocpoc_mmap.cpp b/platforms/posix/src/drivers/linux_pwm_out/ocpoc_mmap.cpp
similarity index 100%
rename from src/drivers/linux_pwm_out/ocpoc_mmap.cpp
rename to platforms/posix/src/drivers/linux_pwm_out/ocpoc_mmap.cpp
diff --git a/src/drivers/linux_pwm_out/ocpoc_mmap.h b/platforms/posix/src/drivers/linux_pwm_out/ocpoc_mmap.h
similarity index 100%
rename from src/drivers/linux_pwm_out/ocpoc_mmap.h
rename to platforms/posix/src/drivers/linux_pwm_out/ocpoc_mmap.h
diff --git a/src/drivers/navio_adc/CMakeLists.txt b/platforms/posix/src/drivers/navio_adc/CMakeLists.txt
similarity index 100%
rename from src/drivers/navio_adc/CMakeLists.txt
rename to platforms/posix/src/drivers/navio_adc/CMakeLists.txt
diff --git a/src/drivers/navio_adc/navio_adc.cpp b/platforms/posix/src/drivers/navio_adc/navio_adc.cpp
similarity index 100%
rename from src/drivers/navio_adc/navio_adc.cpp
rename to platforms/posix/src/drivers/navio_adc/navio_adc.cpp
diff --git a/src/drivers/navio_rgbled/CMakeLists.txt b/platforms/posix/src/drivers/navio_rgbled/CMakeLists.txt
similarity index 100%
rename from src/drivers/navio_rgbled/CMakeLists.txt
rename to platforms/posix/src/drivers/navio_rgbled/CMakeLists.txt
diff --git a/src/drivers/navio_rgbled/navio_rgbled.cpp b/platforms/posix/src/drivers/navio_rgbled/navio_rgbled.cpp
similarity index 100%
rename from src/drivers/navio_rgbled/navio_rgbled.cpp
rename to platforms/posix/src/drivers/navio_rgbled/navio_rgbled.cpp
diff --git a/src/drivers/navio_rgbled/navio_rgbled.h b/platforms/posix/src/drivers/navio_rgbled/navio_rgbled.h
similarity index 100%
rename from src/drivers/navio_rgbled/navio_rgbled.h
rename to platforms/posix/src/drivers/navio_rgbled/navio_rgbled.h
diff --git a/src/drivers/navio_rgbled/test/CMakeLists.txt b/platforms/posix/src/drivers/navio_rgbled/test/CMakeLists.txt
similarity index 100%
rename from src/drivers/navio_rgbled/test/CMakeLists.txt
rename to platforms/posix/src/drivers/navio_rgbled/test/CMakeLists.txt
diff --git a/src/drivers/navio_rgbled/test/main.cpp b/platforms/posix/src/drivers/navio_rgbled/test/main.cpp
similarity index 100%
rename from src/drivers/navio_rgbled/test/main.cpp
rename to platforms/posix/src/drivers/navio_rgbled/test/main.cpp
diff --git a/src/drivers/navio_rgbled/test/test.cpp b/platforms/posix/src/drivers/navio_rgbled/test/test.cpp
similarity index 100%
rename from src/drivers/navio_rgbled/test/test.cpp
rename to platforms/posix/src/drivers/navio_rgbled/test/test.cpp
diff --git a/src/drivers/navio_sysfs_rc_in/CMakeLists.txt b/platforms/posix/src/drivers/navio_sysfs_rc_in/CMakeLists.txt
similarity index 100%
rename from src/drivers/navio_sysfs_rc_in/CMakeLists.txt
rename to platforms/posix/src/drivers/navio_sysfs_rc_in/CMakeLists.txt
diff --git a/src/drivers/navio_sysfs_rc_in/navio_sysfs_rc_in.cpp b/platforms/posix/src/drivers/navio_sysfs_rc_in/navio_sysfs_rc_in.cpp
similarity index 100%
rename from src/drivers/navio_sysfs_rc_in/navio_sysfs_rc_in.cpp
rename to platforms/posix/src/drivers/navio_sysfs_rc_in/navio_sysfs_rc_in.cpp
diff --git a/src/drivers/qshell/posix/CMakeLists.txt b/platforms/posix/src/drivers/qshell/posix/CMakeLists.txt
similarity index 100%
rename from src/drivers/qshell/posix/CMakeLists.txt
rename to platforms/posix/src/drivers/qshell/posix/CMakeLists.txt
diff --git a/src/drivers/qshell/posix/qshell.cpp b/platforms/posix/src/drivers/qshell/posix/qshell.cpp
similarity index 100%
rename from src/drivers/qshell/posix/qshell.cpp
rename to platforms/posix/src/drivers/qshell/posix/qshell.cpp
diff --git a/src/drivers/qshell/posix/qshell.h b/platforms/posix/src/drivers/qshell/posix/qshell.h
similarity index 100%
rename from src/drivers/qshell/posix/qshell.h
rename to platforms/posix/src/drivers/qshell/posix/qshell.h
diff --git a/src/drivers/qshell/posix/qshell_start_posix.cpp b/platforms/posix/src/drivers/qshell/posix/qshell_start_posix.cpp
similarity index 100%
rename from src/drivers/qshell/posix/qshell_start_posix.cpp
rename to platforms/posix/src/drivers/qshell/posix/qshell_start_posix.cpp
diff --git a/src/firmware/posix/CMakeLists.txt b/platforms/posix/src/firmware/posix/CMakeLists.txt
similarity index 92%
rename from src/firmware/posix/CMakeLists.txt
rename to platforms/posix/src/firmware/posix/CMakeLists.txt
index 3287548e0d4e..7da304cfea37 100644
--- a/src/firmware/posix/CMakeLists.txt
+++ b/platforms/posix/src/firmware/posix/CMakeLists.txt
@@ -16,7 +16,7 @@ if ("${BOARD}" STREQUAL "eagle" OR ("${BOARD}" STREQUAL "excelsior"))
include(fastrpc)
include(linux_app)
- FASTRPC_STUB_GEN(../qurt/px4muorb.idl)
+ FASTRPC_STUB_GEN(${PX4_SOURCE_DIR}/src/modules/muorb/px4muorb.idl)
set(CMAKE_C_FLAGS "${CMAKE_C_FLAGS} -Wno-missing-prototypes -Wno-missing-declarations")
LINUX_APP(
@@ -40,7 +40,7 @@ if ("${BOARD}" STREQUAL "eagle" OR ("${BOARD}" STREQUAL "excelsior"))
OS ${OS}
BOARD ${BOARD}
FILES ${CMAKE_CURRENT_BINARY_DIR}/${APP_NAME}
- ${PX4_SOURCE_DIR}/posix-configs/eagle/flight/mainapp.config
+ ${PX4_SOURCE_DIR}/platforms/posix/posix-configs/eagle/flight/mainapp.config
DEPENDS ${APP_NAME}
DEST /home/linaro)
@@ -60,7 +60,7 @@ elseif ("${BOARD}" STREQUAL "rpi")
-Wl,--end-group
)
- file(GLOB RPI_CONFIG_FILES ${PX4_SOURCE_DIR}/posix-configs/rpi/*.config)
+ file(GLOB RPI_CONFIG_FILES ${PX4_SOURCE_DIR}/platforms/posix/posix-configs/rpi/*.config)
px4_add_scp_push(OUT ${UPLOAD_NAME}
OS ${OS}
BOARD ${BOARD}
diff --git a/src/firmware/posix/sitl_target.cmake b/platforms/posix/src/firmware/posix/sitl_target.cmake
similarity index 100%
rename from src/firmware/posix/sitl_target.cmake
rename to platforms/posix/src/firmware/posix/sitl_target.cmake
diff --git a/src/firmware/posix/sitl_tests.cmake b/platforms/posix/src/firmware/posix/sitl_tests.cmake
similarity index 88%
rename from src/firmware/posix/sitl_tests.cmake
rename to platforms/posix/src/firmware/posix/sitl_tests.cmake
index b67d2f3daeaf..3005e3010cab 100644
--- a/src/firmware/posix/sitl_tests.cmake
+++ b/platforms/posix/src/firmware/posix/sitl_tests.cmake
@@ -40,12 +40,12 @@ if (${CMAKE_SYSTEM_NAME} MATCHES "Darwin")
endif()
foreach(test_name ${tests})
- configure_file(${PX4_SOURCE_DIR}/posix-configs/SITL/init/test/test_template.in ${PX4_SOURCE_DIR}/posix-configs/SITL/init/test/test_${test_name}_generated)
+ configure_file(${PX4_SOURCE_DIR}/platforms/posix/posix-configs/SITL/init/test/test_template.in ${PX4_SOURCE_DIR}/platforms/posix/posix-configs/SITL/init/test/test_${test_name}_generated)
add_test(NAME ${test_name}
COMMAND ${PX4_SOURCE_DIR}/Tools/sitl_run.sh
$
- posix-configs/SITL/init/test
+ platforms/posix/posix-configs/SITL/init/test
none
none
test_${test_name}_generated
diff --git a/src/modules/muorb/krait/CMakeLists.txt b/platforms/posix/src/modules/muorb/krait/CMakeLists.txt
similarity index 91%
rename from src/modules/muorb/krait/CMakeLists.txt
rename to platforms/posix/src/modules/muorb/krait/CMakeLists.txt
index ad0549202659..fbbb4ae17757 100644
--- a/src/modules/muorb/krait/CMakeLists.txt
+++ b/platforms/posix/src/modules/muorb/krait/CMakeLists.txt
@@ -30,10 +30,10 @@
# POSSIBILITY OF SUCH DAMAGE.
#
############################################################################
-set(CMAKE_MODULE_PATH ${CMAKE_MODULE_PATH} "${PX4_SOURCE_DIR}/cmake/cmake_hexagon")
+set(CMAKE_MODULE_PATH ${CMAKE_MODULE_PATH} "${PX4_SOURCE_DIR}/platforms/qurt/cmake/cmake_hexagon")
include(hexagon_sdk)
-include_directories(${PX4_BINARY_DIR}/src/firmware/posix)
+include_directories(${PX4_BINARY_DIR}/platforms/posix/src/firmware/posix)
include_directories(${HEXAGON_SDK_INCLUDES})
px4_add_module(
diff --git a/src/modules/muorb/krait/muorb_main.cpp b/platforms/posix/src/modules/muorb/krait/muorb_main.cpp
similarity index 100%
rename from src/modules/muorb/krait/muorb_main.cpp
rename to platforms/posix/src/modules/muorb/krait/muorb_main.cpp
diff --git a/src/modules/muorb/krait/px4muorb_KraitRpcWrapper.cpp b/platforms/posix/src/modules/muorb/krait/px4muorb_KraitRpcWrapper.cpp
similarity index 100%
rename from src/modules/muorb/krait/px4muorb_KraitRpcWrapper.cpp
rename to platforms/posix/src/modules/muorb/krait/px4muorb_KraitRpcWrapper.cpp
diff --git a/src/modules/muorb/krait/px4muorb_KraitRpcWrapper.hpp b/platforms/posix/src/modules/muorb/krait/px4muorb_KraitRpcWrapper.hpp
similarity index 100%
rename from src/modules/muorb/krait/px4muorb_KraitRpcWrapper.hpp
rename to platforms/posix/src/modules/muorb/krait/px4muorb_KraitRpcWrapper.hpp
diff --git a/src/modules/muorb/krait/uORBKraitFastRpcChannel.cpp b/platforms/posix/src/modules/muorb/krait/uORBKraitFastRpcChannel.cpp
similarity index 100%
rename from src/modules/muorb/krait/uORBKraitFastRpcChannel.cpp
rename to platforms/posix/src/modules/muorb/krait/uORBKraitFastRpcChannel.cpp
diff --git a/src/modules/muorb/krait/uORBKraitFastRpcChannel.hpp b/platforms/posix/src/modules/muorb/krait/uORBKraitFastRpcChannel.hpp
similarity index 100%
rename from src/modules/muorb/krait/uORBKraitFastRpcChannel.hpp
rename to platforms/posix/src/modules/muorb/krait/uORBKraitFastRpcChannel.hpp
diff --git a/Tools/px4_snapflight_sanitytest.sh b/platforms/qurt/Tools/px4_snapflight_sanitytest.sh
similarity index 93%
rename from Tools/px4_snapflight_sanitytest.sh
rename to platforms/qurt/Tools/px4_snapflight_sanitytest.sh
index 1cbd11739339..01a71893649d 100755
--- a/Tools/px4_snapflight_sanitytest.sh
+++ b/platforms/qurt/Tools/px4_snapflight_sanitytest.sh
@@ -159,23 +159,23 @@ installpx4() {
adb push $workspace/build_qurt_eagle_default/src/firmware/qurt/libpx4.so /usr/share/data/adsp
adb push $workspace/build_qurt_eagle_default/src/firmware/qurt/libpx4muorb_skel.so /usr/share/data/adsp
adb push $workspace/build_posix_eagle_default/src/firmware/posix/px4 /home/linaro
- adb push $workspace/posix-configs/eagle/flight/px4.config /usr/share/data/adsp
- adb push $workspace/posix-configs/eagle/flight/mainapp.config /home/linaro
+ adb push $workspace/platforms/posix/posix-configs/eagle/flight/px4.config /usr/share/data/adsp
+ adb push $workspace/platforms/posix/posix-configs/eagle/flight/mainapp.config /home/linaro
elif [ $mode == 1 ]; then
# copy legacy binaries
echo -e "Copying the PX4 binaries from the eagle_legacy build tree..."
adb push $workspace/build_qurt_eagle_legacy/src/firmware/qurt/libpx4.so /usr/share/data/adsp
adb push $workspace/build_qurt_eagle_legacy/src/firmware/qurt/libpx4muorb_skel.so /usr/share/data/adsp
adb push $workspace/build_posix_eagle_legacy/src/firmware/posix/px4 /home/linaro
- adb push $workspace/posix-configs/eagle/200qx/px4.config /usr/share/data/adsp
- adb push $workspace/posix-configs/eagle/200qx/mainapp.config /home/linaro
+ adb push $workspace/platforms/posix/posix-configs/eagle/200qx/px4.config /usr/share/data/adsp
+ adb push $workspace/platforms/posix/posix-configs/eagle/200qx/mainapp.config /home/linaro
else
echo -e "Copying the PX4 binaries from the excelsior_legacy build tree..."
adb push $workspace/build_qurt_excelsior_legacy/src/firmware/qurt/libpx4.so /usr/lib/rfsa/adsp
adb push $workspace/build_qurt_excelsior_legacy/src/firmware/qurt/libpx4muorb_skel.so /usr/lib/rfsa/adsp
adb push $workspace/build_posix_excelsior_legacy/src/firmware/posix/px4 /home/root
- adb push $workspace/posix-configs/excelsior/px4.config /usr/lib/rfsa/adsp
- adb push $workspace/posix-configs/excelsior/mainapp.config /home/root
+ adb push $workspace/platforms/posix/posix-configs/excelsior/px4.config /usr/lib/rfsa/adsp
+ adb push $workspace/platforms/posix/posix-configs/excelsior/mainapp.config /home/root
fi
echo -e "Installation complete."
diff --git a/platforms/qurt/cmake/cmake_hexagon b/platforms/qurt/cmake/cmake_hexagon
new file mode 160000
index 000000000000..b0707da62f86
--- /dev/null
+++ b/platforms/qurt/cmake/cmake_hexagon
@@ -0,0 +1 @@
+Subproject commit b0707da62f869ea576c3b3be95e60fed1b3b6aa4
diff --git a/cmake/qurt/px4_impl_qurt.cmake b/platforms/qurt/cmake/qurt/px4_impl_qurt.cmake
similarity index 99%
rename from cmake/qurt/px4_impl_qurt.cmake
rename to platforms/qurt/cmake/qurt/px4_impl_qurt.cmake
index d6d2ce4082df..6f41e8710c62 100644
--- a/cmake/qurt/px4_impl_qurt.cmake
+++ b/platforms/qurt/cmake/qurt/px4_impl_qurt.cmake
@@ -167,7 +167,7 @@ function(px4_os_add_flags)
${DSPAL_ROOT}/sys/sys
${DSPAL_ROOT}/mpu_spi/inc
${DSPAL_ROOT}/uart_esc/inc
- src/platforms/qurt/include
+ platforms/qurt/src/platforms/qurt/include
src/platforms/posix/include
)
diff --git a/cmake/qurt/qurt_eigen.patch b/platforms/qurt/cmake/qurt/qurt_eigen.patch
similarity index 100%
rename from cmake/qurt/qurt_eigen.patch
rename to platforms/qurt/cmake/qurt/qurt_eigen.patch
diff --git a/cmake/qurt/qurt_funcs.cmake b/platforms/qurt/cmake/qurt/qurt_funcs.cmake
similarity index 100%
rename from cmake/qurt/qurt_funcs.cmake
rename to platforms/qurt/cmake/qurt/qurt_funcs.cmake
diff --git a/src/drivers/qshell/qurt/CMakeLists.txt b/platforms/qurt/src/drivers/qshell/qurt/CMakeLists.txt
similarity index 100%
rename from src/drivers/qshell/qurt/CMakeLists.txt
rename to platforms/qurt/src/drivers/qshell/qurt/CMakeLists.txt
diff --git a/src/drivers/qshell/qurt/qshell.cpp b/platforms/qurt/src/drivers/qshell/qurt/qshell.cpp
similarity index 100%
rename from src/drivers/qshell/qurt/qshell.cpp
rename to platforms/qurt/src/drivers/qshell/qurt/qshell.cpp
diff --git a/src/drivers/qshell/qurt/qshell.h b/platforms/qurt/src/drivers/qshell/qurt/qshell.h
similarity index 100%
rename from src/drivers/qshell/qurt/qshell.h
rename to platforms/qurt/src/drivers/qshell/qurt/qshell.h
diff --git a/src/drivers/qshell/qurt/qshell_main.cpp b/platforms/qurt/src/drivers/qshell/qurt/qshell_main.cpp
similarity index 100%
rename from src/drivers/qshell/qurt/qshell_main.cpp
rename to platforms/qurt/src/drivers/qshell/qurt/qshell_main.cpp
diff --git a/src/drivers/qshell/qurt/qshell_start_qurt.cpp b/platforms/qurt/src/drivers/qshell/qurt/qshell_start_qurt.cpp
similarity index 100%
rename from src/drivers/qshell/qurt/qshell_start_qurt.cpp
rename to platforms/qurt/src/drivers/qshell/qurt/qshell_start_qurt.cpp
diff --git a/src/drivers/snapdragon_pwm_out/CMakeLists.txt b/platforms/qurt/src/drivers/snapdragon_pwm_out/CMakeLists.txt
similarity index 100%
rename from src/drivers/snapdragon_pwm_out/CMakeLists.txt
rename to platforms/qurt/src/drivers/snapdragon_pwm_out/CMakeLists.txt
diff --git a/src/drivers/snapdragon_pwm_out/snapdragon_pwm_out.cpp b/platforms/qurt/src/drivers/snapdragon_pwm_out/snapdragon_pwm_out.cpp
similarity index 100%
rename from src/drivers/snapdragon_pwm_out/snapdragon_pwm_out.cpp
rename to platforms/qurt/src/drivers/snapdragon_pwm_out/snapdragon_pwm_out.cpp
diff --git a/src/firmware/qurt/CMakeLists.txt b/platforms/qurt/src/firmware/qurt/CMakeLists.txt
similarity index 90%
rename from src/firmware/qurt/CMakeLists.txt
rename to platforms/qurt/src/firmware/qurt/CMakeLists.txt
index 3909ecb53db0..9f4aa87c8321 100644
--- a/src/firmware/qurt/CMakeLists.txt
+++ b/platforms/qurt/src/firmware/qurt/CMakeLists.txt
@@ -1,4 +1,3 @@
-set(CMAKE_MODULE_PATH ${CMAKE_MODULE_PATH} "${PX4_SOURCE_DIR}/cmake/cmake_hexagon")
include(common/px4_upload)
include(toolchain/Toolchain-qurt)
include(fastrpc)
@@ -13,7 +12,7 @@ px4_qurt_generate_builtin_commands(
OUT ${PX4_BINARY_DIR}/apps
MODULE_LIST ${module_libraries})
-FASTRPC_STUB_GEN(px4muorb.idl)
+FASTRPC_STUB_GEN(${PX4_SOURCE_DIR}/src/modules/muorb/px4muorb.idl)
# Enable build without HexagonSDK to check link dependencies
if ("${QURT_ENABLE_STUBS}" STREQUAL "1")
@@ -57,7 +56,7 @@ else()
BOARD ${BOARD}
FILES ${CMAKE_CURRENT_BINARY_DIR}/libpx4.so
${CMAKE_CURRENT_BINARY_DIR}/libpx4muorb_skel.so
- ${PX4_SOURCE_DIR}/posix-configs/eagle/flight/px4.config
+ ${PX4_SOURCE_DIR}/platforms/posix/posix-configs/eagle/flight/px4.config
DEPENDS px4 px4muorb_skel
DEST /usr/share/data/adsp)
endif()
diff --git a/src/modules/muorb/adsp/CMakeLists.txt b/platforms/qurt/src/modules/muorb/adsp/CMakeLists.txt
similarity index 97%
rename from src/modules/muorb/adsp/CMakeLists.txt
rename to platforms/qurt/src/modules/muorb/adsp/CMakeLists.txt
index b64c3cd92956..6a8f887e9472 100644
--- a/src/modules/muorb/adsp/CMakeLists.txt
+++ b/platforms/qurt/src/modules/muorb/adsp/CMakeLists.txt
@@ -30,7 +30,7 @@
# POSSIBILITY OF SUCH DAMAGE.
#
############################################################################
-include_directories("../../uORB")
+include_directories("${PX4_SOURCE_DIR}/src/modules/uORB")
px4_add_module(
MODULE modules__muorb__adsp
diff --git a/src/modules/muorb/adsp/px4muorb.cpp b/platforms/qurt/src/modules/muorb/adsp/px4muorb.cpp
similarity index 100%
rename from src/modules/muorb/adsp/px4muorb.cpp
rename to platforms/qurt/src/modules/muorb/adsp/px4muorb.cpp
diff --git a/src/modules/muorb/adsp/px4muorb.hpp b/platforms/qurt/src/modules/muorb/adsp/px4muorb.hpp
similarity index 100%
rename from src/modules/muorb/adsp/px4muorb.hpp
rename to platforms/qurt/src/modules/muorb/adsp/px4muorb.hpp
diff --git a/src/modules/muorb/adsp/uORBFastRpcChannel.cpp b/platforms/qurt/src/modules/muorb/adsp/uORBFastRpcChannel.cpp
similarity index 100%
rename from src/modules/muorb/adsp/uORBFastRpcChannel.cpp
rename to platforms/qurt/src/modules/muorb/adsp/uORBFastRpcChannel.cpp
diff --git a/src/modules/muorb/adsp/uORBFastRpcChannel.hpp b/platforms/qurt/src/modules/muorb/adsp/uORBFastRpcChannel.hpp
similarity index 100%
rename from src/modules/muorb/adsp/uORBFastRpcChannel.hpp
rename to platforms/qurt/src/modules/muorb/adsp/uORBFastRpcChannel.hpp
diff --git a/src/platforms/qurt/fc_addon/mpu_spi/CMakeLists.txt b/platforms/qurt/src/platforms/qurt/fc_addon/mpu_spi/CMakeLists.txt
similarity index 100%
rename from src/platforms/qurt/fc_addon/mpu_spi/CMakeLists.txt
rename to platforms/qurt/src/platforms/qurt/fc_addon/mpu_spi/CMakeLists.txt
diff --git a/src/platforms/qurt/fc_addon/mpu_spi/mpu9x50_main.cpp b/platforms/qurt/src/platforms/qurt/fc_addon/mpu_spi/mpu9x50_main.cpp
similarity index 100%
rename from src/platforms/qurt/fc_addon/mpu_spi/mpu9x50_main.cpp
rename to platforms/qurt/src/platforms/qurt/fc_addon/mpu_spi/mpu9x50_main.cpp
diff --git a/src/platforms/qurt/fc_addon/mpu_spi/mpu9x50_params.c b/platforms/qurt/src/platforms/qurt/fc_addon/mpu_spi/mpu9x50_params.c
similarity index 100%
rename from src/platforms/qurt/fc_addon/mpu_spi/mpu9x50_params.c
rename to platforms/qurt/src/platforms/qurt/fc_addon/mpu_spi/mpu9x50_params.c
diff --git a/src/platforms/qurt/fc_addon/rc_receiver/CMakeLists.txt b/platforms/qurt/src/platforms/qurt/fc_addon/rc_receiver/CMakeLists.txt
similarity index 100%
rename from src/platforms/qurt/fc_addon/rc_receiver/CMakeLists.txt
rename to platforms/qurt/src/platforms/qurt/fc_addon/rc_receiver/CMakeLists.txt
diff --git a/src/platforms/qurt/fc_addon/rc_receiver/rc_receiver_main.cpp b/platforms/qurt/src/platforms/qurt/fc_addon/rc_receiver/rc_receiver_main.cpp
similarity index 100%
rename from src/platforms/qurt/fc_addon/rc_receiver/rc_receiver_main.cpp
rename to platforms/qurt/src/platforms/qurt/fc_addon/rc_receiver/rc_receiver_main.cpp
diff --git a/src/platforms/qurt/fc_addon/rc_receiver/rc_receiver_params.c b/platforms/qurt/src/platforms/qurt/fc_addon/rc_receiver/rc_receiver_params.c
similarity index 100%
rename from src/platforms/qurt/fc_addon/rc_receiver/rc_receiver_params.c
rename to platforms/qurt/src/platforms/qurt/fc_addon/rc_receiver/rc_receiver_params.c
diff --git a/src/platforms/qurt/fc_addon/uart_esc/CMakeLists.txt b/platforms/qurt/src/platforms/qurt/fc_addon/uart_esc/CMakeLists.txt
similarity index 100%
rename from src/platforms/qurt/fc_addon/uart_esc/CMakeLists.txt
rename to platforms/qurt/src/platforms/qurt/fc_addon/uart_esc/CMakeLists.txt
diff --git a/src/platforms/qurt/fc_addon/uart_esc/uart_esc_main.cpp b/platforms/qurt/src/platforms/qurt/fc_addon/uart_esc/uart_esc_main.cpp
similarity index 100%
rename from src/platforms/qurt/fc_addon/uart_esc/uart_esc_main.cpp
rename to platforms/qurt/src/platforms/qurt/fc_addon/uart_esc/uart_esc_main.cpp
diff --git a/src/platforms/qurt/fc_addon/uart_esc/uart_esc_params.c b/platforms/qurt/src/platforms/qurt/fc_addon/uart_esc/uart_esc_params.c
similarity index 100%
rename from src/platforms/qurt/fc_addon/uart_esc/uart_esc_params.c
rename to platforms/qurt/src/platforms/qurt/fc_addon/uart_esc/uart_esc_params.c
diff --git a/src/platforms/qurt/include/arch/board/board.h b/platforms/qurt/src/platforms/qurt/include/arch/board/board.h
similarity index 100%
rename from src/platforms/qurt/include/arch/board/board.h
rename to platforms/qurt/src/platforms/qurt/include/arch/board/board.h
diff --git a/src/platforms/qurt/include/board_config.h b/platforms/qurt/src/platforms/qurt/include/board_config.h
similarity index 85%
rename from src/platforms/qurt/include/board_config.h
rename to platforms/qurt/src/platforms/qurt/include/board_config.h
index e93f66b7f56e..8328bfa2b832 100644
--- a/src/platforms/qurt/include/board_config.h
+++ b/platforms/qurt/src/platforms/qurt/include/board_config.h
@@ -12,4 +12,4 @@
#define BOARD_OVERRIDE_UUID "SYSMEMID"
-#include "../common/board_common.h"
+#include "common/board_common.h"
diff --git a/src/platforms/qurt/include/crc32.h b/platforms/qurt/src/platforms/qurt/include/crc32.h
similarity index 100%
rename from src/platforms/qurt/include/crc32.h
rename to platforms/qurt/src/platforms/qurt/include/crc32.h
diff --git a/src/platforms/qurt/include/hrt_work.h b/platforms/qurt/src/platforms/qurt/include/hrt_work.h
similarity index 100%
rename from src/platforms/qurt/include/hrt_work.h
rename to platforms/qurt/src/platforms/qurt/include/hrt_work.h
diff --git a/src/platforms/qurt/include/i2c.h b/platforms/qurt/src/platforms/qurt/include/i2c.h
similarity index 100%
rename from src/platforms/qurt/include/i2c.h
rename to platforms/qurt/src/platforms/qurt/include/i2c.h
diff --git a/src/platforms/qurt/include/poll.h b/platforms/qurt/src/platforms/qurt/include/poll.h
similarity index 100%
rename from src/platforms/qurt/include/poll.h
rename to platforms/qurt/src/platforms/qurt/include/poll.h
diff --git a/src/platforms/qurt/include/queue.h b/platforms/qurt/src/platforms/qurt/include/queue.h
similarity index 100%
rename from src/platforms/qurt/include/queue.h
rename to platforms/qurt/src/platforms/qurt/include/queue.h
diff --git a/src/platforms/qurt/include/qurt_log.h b/platforms/qurt/src/platforms/qurt/include/qurt_log.h
similarity index 100%
rename from src/platforms/qurt/include/qurt_log.h
rename to platforms/qurt/src/platforms/qurt/include/qurt_log.h
diff --git a/src/platforms/qurt/include/sys/ioctl.h b/platforms/qurt/src/platforms/qurt/include/sys/ioctl.h
similarity index 100%
rename from src/platforms/qurt/include/sys/ioctl.h
rename to platforms/qurt/src/platforms/qurt/include/sys/ioctl.h
diff --git a/src/platforms/qurt/px4_layer/CMakeLists.txt b/platforms/qurt/src/platforms/qurt/px4_layer/CMakeLists.txt
similarity index 94%
rename from src/platforms/qurt/px4_layer/CMakeLists.txt
rename to platforms/qurt/src/platforms/qurt/px4_layer/CMakeLists.txt
index 7b913cfdbf4f..ccf6ac9751cd 100644
--- a/src/platforms/qurt/px4_layer/CMakeLists.txt
+++ b/platforms/qurt/src/platforms/qurt/px4_layer/CMakeLists.txt
@@ -30,7 +30,6 @@
# POSSIBILITY OF SUCH DAMAGE.
#
############################################################################
-set(CMAKE_MODULE_PATH ${CMAKE_MODULE_PATH} "${PX4_SOURCE_DIR}/cmake/cmake_hexagon")
include(hexagon_sdk)
include_directories(${HEXAGON_8074_INCLUDES})
@@ -39,7 +38,7 @@ set(QURT_LAYER_SRCS
px4_qurt_impl.cpp
px4_qurt_tasks.cpp
lib_crc32.c
- ../../posix/px4_layer/drv_hrt.c
+ ${PX4_SOURCE_DIR}/src/platforms/posix/px4_layer/drv_hrt.c
qurt_stubs.c
main.cpp
shmem_qurt.c
diff --git a/src/platforms/qurt/px4_layer/commands_hil.c b/platforms/qurt/src/platforms/qurt/px4_layer/commands_hil.c
similarity index 100%
rename from src/platforms/qurt/px4_layer/commands_hil.c
rename to platforms/qurt/src/platforms/qurt/px4_layer/commands_hil.c
diff --git a/src/platforms/qurt/px4_layer/drv_hrt.c b/platforms/qurt/src/platforms/qurt/px4_layer/drv_hrt.c
similarity index 100%
rename from src/platforms/qurt/px4_layer/drv_hrt.c
rename to platforms/qurt/src/platforms/qurt/px4_layer/drv_hrt.c
diff --git a/src/platforms/qurt/px4_layer/get_commands.h b/platforms/qurt/src/platforms/qurt/px4_layer/get_commands.h
similarity index 100%
rename from src/platforms/qurt/px4_layer/get_commands.h
rename to platforms/qurt/src/platforms/qurt/px4_layer/get_commands.h
diff --git a/src/platforms/qurt/px4_layer/lib_crc32.c b/platforms/qurt/src/platforms/qurt/px4_layer/lib_crc32.c
similarity index 100%
rename from src/platforms/qurt/px4_layer/lib_crc32.c
rename to platforms/qurt/src/platforms/qurt/px4_layer/lib_crc32.c
diff --git a/src/platforms/qurt/px4_layer/main.cpp b/platforms/qurt/src/platforms/qurt/px4_layer/main.cpp
similarity index 100%
rename from src/platforms/qurt/px4_layer/main.cpp
rename to platforms/qurt/src/platforms/qurt/px4_layer/main.cpp
diff --git a/src/platforms/qurt/px4_layer/px4_qurt_impl.cpp b/platforms/qurt/src/platforms/qurt/px4_layer/px4_qurt_impl.cpp
similarity index 100%
rename from src/platforms/qurt/px4_layer/px4_qurt_impl.cpp
rename to platforms/qurt/src/platforms/qurt/px4_layer/px4_qurt_impl.cpp
diff --git a/src/platforms/qurt/px4_layer/px4_qurt_tasks.cpp b/platforms/qurt/src/platforms/qurt/px4_layer/px4_qurt_tasks.cpp
similarity index 100%
rename from src/platforms/qurt/px4_layer/px4_qurt_tasks.cpp
rename to platforms/qurt/src/platforms/qurt/px4_layer/px4_qurt_tasks.cpp
diff --git a/src/platforms/qurt/px4_layer/qurt_stubs.c b/platforms/qurt/src/platforms/qurt/px4_layer/qurt_stubs.c
similarity index 100%
rename from src/platforms/qurt/px4_layer/qurt_stubs.c
rename to platforms/qurt/src/platforms/qurt/px4_layer/qurt_stubs.c
diff --git a/src/platforms/qurt/px4_layer/shmem_qurt.c b/platforms/qurt/src/platforms/qurt/px4_layer/shmem_qurt.c
similarity index 100%
rename from src/platforms/qurt/px4_layer/shmem_qurt.c
rename to platforms/qurt/src/platforms/qurt/px4_layer/shmem_qurt.c
diff --git a/src/platforms/qurt/stubs/stubs_posix.c b/platforms/qurt/src/platforms/qurt/stubs/stubs_posix.c
similarity index 100%
rename from src/platforms/qurt/stubs/stubs_posix.c
rename to platforms/qurt/src/platforms/qurt/stubs/stubs_posix.c
diff --git a/src/platforms/qurt/stubs/stubs_qurt.c b/platforms/qurt/src/platforms/qurt/stubs/stubs_qurt.c
similarity index 100%
rename from src/platforms/qurt/stubs/stubs_qurt.c
rename to platforms/qurt/src/platforms/qurt/stubs/stubs_qurt.c
diff --git a/src/platforms/qurt/tests/hello/CMakeLists.txt b/platforms/qurt/src/platforms/qurt/tests/hello/CMakeLists.txt
similarity index 100%
rename from src/platforms/qurt/tests/hello/CMakeLists.txt
rename to platforms/qurt/src/platforms/qurt/tests/hello/CMakeLists.txt
diff --git a/src/platforms/qurt/tests/hello/hello_example.cpp b/platforms/qurt/src/platforms/qurt/tests/hello/hello_example.cpp
similarity index 100%
rename from src/platforms/qurt/tests/hello/hello_example.cpp
rename to platforms/qurt/src/platforms/qurt/tests/hello/hello_example.cpp
diff --git a/src/platforms/qurt/tests/hello/hello_example.h b/platforms/qurt/src/platforms/qurt/tests/hello/hello_example.h
similarity index 100%
rename from src/platforms/qurt/tests/hello/hello_example.h
rename to platforms/qurt/src/platforms/qurt/tests/hello/hello_example.h
diff --git a/src/platforms/qurt/tests/hello/hello_main.cpp b/platforms/qurt/src/platforms/qurt/tests/hello/hello_main.cpp
similarity index 100%
rename from src/platforms/qurt/tests/hello/hello_main.cpp
rename to platforms/qurt/src/platforms/qurt/tests/hello/hello_main.cpp
diff --git a/src/platforms/qurt/tests/hello/hello_start_qurt.cpp b/platforms/qurt/src/platforms/qurt/tests/hello/hello_start_qurt.cpp
similarity index 100%
rename from src/platforms/qurt/tests/hello/hello_start_qurt.cpp
rename to platforms/qurt/src/platforms/qurt/tests/hello/hello_start_qurt.cpp
diff --git a/src/platforms/qurt/tests/muorb/CMakeLists.txt b/platforms/qurt/src/platforms/qurt/tests/muorb/CMakeLists.txt
similarity index 100%
rename from src/platforms/qurt/tests/muorb/CMakeLists.txt
rename to platforms/qurt/src/platforms/qurt/tests/muorb/CMakeLists.txt
diff --git a/src/platforms/qurt/tests/muorb/muorb_test_example.cpp b/platforms/qurt/src/platforms/qurt/tests/muorb/muorb_test_example.cpp
similarity index 100%
rename from src/platforms/qurt/tests/muorb/muorb_test_example.cpp
rename to platforms/qurt/src/platforms/qurt/tests/muorb/muorb_test_example.cpp
diff --git a/src/platforms/qurt/tests/muorb/muorb_test_example.h b/platforms/qurt/src/platforms/qurt/tests/muorb/muorb_test_example.h
similarity index 100%
rename from src/platforms/qurt/tests/muorb/muorb_test_example.h
rename to platforms/qurt/src/platforms/qurt/tests/muorb/muorb_test_example.h
diff --git a/src/platforms/qurt/tests/muorb/muorb_test_main.cpp b/platforms/qurt/src/platforms/qurt/tests/muorb/muorb_test_main.cpp
similarity index 100%
rename from src/platforms/qurt/tests/muorb/muorb_test_main.cpp
rename to platforms/qurt/src/platforms/qurt/tests/muorb/muorb_test_main.cpp
diff --git a/src/platforms/qurt/tests/muorb/muorb_test_start_qurt.cpp b/platforms/qurt/src/platforms/qurt/tests/muorb/muorb_test_start_qurt.cpp
similarity index 100%
rename from src/platforms/qurt/tests/muorb/muorb_test_start_qurt.cpp
rename to platforms/qurt/src/platforms/qurt/tests/muorb/muorb_test_start_qurt.cpp
diff --git a/src/lib/version/version.c b/src/lib/version/version.c
index f1345a5db1b5..1921138a157b 100644
--- a/src/lib/version/version.c
+++ b/src/lib/version/version.c
@@ -33,13 +33,11 @@
#include "version.h"
-#include "build_git_version.h" //generated from build_git_version.h.in
+#include "build_git_version.h" //generated from px_update_git_header.py
#include
-#if !defined(CONFIG_CDCACM_PRODUCTID)
-# define CONFIG_CDCACM_PRODUCTID 0
-#endif
+uint32_t version_tag_to_number(const char *tag);
#if defined(__PX4_LINUX)
#include
@@ -96,7 +94,7 @@ static uint32_t string_to_int(const char *tag, int start, int end)
* - linux: 7.9.3
* @return version in the form 0xAABBCCTT (AA: Major, BB: Minor, CC: Patch, TT Type @see FIRMWARE_TYPE)
*/
-static uint32_t version_tag_to_number(const char *tag)
+uint32_t version_tag_to_number(const char *tag)
{
uint32_t ver = 0;
unsigned len = strlen(tag);
@@ -206,13 +204,10 @@ const char *px4_firmware_git_branch(void)
return PX4_GIT_BRANCH_NAME;
}
+#if !defined(__PX4_NUTTX)
uint32_t px4_board_version(void)
{
-#if defined(__PX4_NUTTX)
- return CONFIG_CDCACM_PRODUCTID;
-#else
return 1;
-#endif
}
uint32_t px4_os_version(void)
@@ -239,8 +234,6 @@ uint32_t px4_os_version(void)
#elif defined(__PX4_QURT)
return 0; //TODO: implement version for QuRT
-#elif defined(__PX4_NUTTX)
- return version_tag_to_number(NUTTX_GIT_TAG_STR);
#else
# error "px4_os_version not implemented for current OS"
#endif
@@ -248,11 +241,7 @@ uint32_t px4_os_version(void)
const char *px4_os_version_string(void)
{
-#if defined(__PX4_NUTTX)
- return NUTTX_GIT_VERSION_STR;
-#else
return NULL;
-#endif
}
const char *px4_os_name(void)
@@ -263,12 +252,11 @@ const char *px4_os_name(void)
return "Linux";
#elif defined(__PX4_QURT)
return "QuRT";
-#elif defined(__PX4_NUTTX)
- return "NuttX";
#else
# error "px4_os_name not implemented for current OS"
#endif
}
+#endif // Not Nuttx
const char *px4_toolchain_name(void)
{
diff --git a/src/modules/micrortps_bridge/micrortps_client/CMakeLists.txt b/src/modules/micrortps_bridge/micrortps_client/CMakeLists.txt
index 65967fa35aec..fc3cd3dd8b55 100644
--- a/src/modules/micrortps_bridge/micrortps_client/CMakeLists.txt
+++ b/src/modules/micrortps_bridge/micrortps_client/CMakeLists.txt
@@ -35,6 +35,9 @@ if(NOT GENERATE_RTPS_BRIDGE MATCHES "off")
find_program(FASTRTPSGEN fastrtpsgen
PATHS $ENV{FASTRTPSGEN_DIR})
+
+ message(STATUS "FASTRTPSGEN = ${FASTRTPSGEN}")
+
if(NOT FASTRTPSGEN)
message(WARNING "WARNING: Unable to find fastrtpsgen. Building PX4 without RTPS bridge support")
px4_add_module(
diff --git a/src/firmware/qurt/px4muorb.idl b/src/modules/muorb/px4muorb.idl
similarity index 100%
rename from src/firmware/qurt/px4muorb.idl
rename to src/modules/muorb/px4muorb.idl
diff --git a/src/modules/systemlib/mixer/mixer_load.c b/src/modules/systemlib/mixer/mixer_load.c
index cee01c83bddc..951d5ef11095 100644
--- a/src/modules/systemlib/mixer/mixer_load.c
+++ b/src/modules/systemlib/mixer/mixer_load.c
@@ -54,7 +54,7 @@ int load_mixer_file(const char *fname, char *buf, unsigned maxlen)
fp = fopen(fname, "r");
if (fp == NULL) {
- warnx("file not found");
+ warnx("file not found: %s", fname);
return -1;
}
diff --git a/src/modules/systemlib/param/CMakeLists.txt b/src/modules/systemlib/param/CMakeLists.txt
index afbedbd7af07..e8eda1585e5c 100644
--- a/src/modules/systemlib/param/CMakeLists.txt
+++ b/src/modules/systemlib/param/CMakeLists.txt
@@ -51,7 +51,7 @@ endif()
set(module_list)
if (DISABLE_PARAMS_MODULE_SCOPING)
# search all directories with .c files (potentially containing parameters)
- file(GLOB_RECURSE new_list ${PX4_SOURCE_DIR}/src/*.c)
+ file(GLOB_RECURSE new_list ${PX4_SOURCE_DIR}/src/*.c ${PX4_SOURCE_DIR}/platforms/${OS}/src/*.c)
foreach(file_path ${new_list})
get_filename_component(dir_path ${file_path} PATH)
list(APPEND module_list "${dir_path}")
@@ -59,12 +59,16 @@ if (DISABLE_PARAMS_MODULE_SCOPING)
list(REMOVE_DUPLICATES module_list)
else()
foreach(module ${config_module_list})
- list(APPEND module_list ${PX4_SOURCE_DIR}/src/${module})
+ if (EXISTS ${PX4_SOURCE_DIR}/platforms/${OS}/src/${module}/CMakeLists.txt)
+ list(APPEND module_list ${PX4_SOURCE_DIR}/platforms/${OS}/src/${module})
+ else()
+ list(APPEND module_list ${PX4_SOURCE_DIR}/src/${module})
+ endif()
endforeach()
endif()
set(parameters_xml ${PX4_BINARY_DIR}/parameters.xml)
-file(GLOB_RECURSE param_src_files ${PX4_SOURCE_DIR}/src/*params.c)
+file(GLOB_RECURSE param_src_files ${PX4_SOURCE_DIR}/src/*params.c ${PX4_SOURCE_DIR}/platforms/${OS}/src/*params.c)
add_custom_command(OUTPUT ${parameters_xml}
COMMAND ${PYTHON_EXECUTABLE} ${PX4_SOURCE_DIR}/Tools/px_process_params.py
-s ${module_list} ${EXTERNAL_MODULES_LOCATION}
diff --git a/src/modules/uavcan/libuavcan b/src/modules/uavcan/libuavcan
deleted file mode 160000
index 215117df72ba..000000000000
--- a/src/modules/uavcan/libuavcan
+++ /dev/null
@@ -1 +0,0 @@
-Subproject commit 215117df72bacb9989667ea12c39ab52f026f0cf
diff --git a/src/platforms/posix/main.cpp b/src/platforms/posix/main.cpp
index 3a66b60a7623..d7b89108c8b1 100644
--- a/src/platforms/posix/main.cpp
+++ b/src/platforms/posix/main.cpp
@@ -401,21 +401,27 @@ int main(int argc, char **argv)
if (symlinks_needed) {
vector path_sym_links;
path_sym_links.push_back("ROMFS");
- path_sym_links.push_back("posix-configs");
+ path_sym_links.push_back("platforms/posix/posix-configs");
path_sym_links.push_back("test_data");
+ string config_path(pwd() + "/platforms/posix");
+ int ret = mkpath(config_path.c_str(), S_IRUSR | S_IWUSR | S_IXUSR);
+
+ if (ret != 0) {
+ PX4_ERR("Error creating path %s, %d", config_path.c_str(), ret);
+ return ret;
+ }
+
for (int i = 0; i < path_sym_links.size(); i++) {
string path_sym_link = path_sym_links[i];
//cout << "path sym link: " << path_sym_link << endl;
string src_path = data_path + "/" + path_sym_link;
string dest_path = pwd() + "/" + path_sym_link;
- PX4_DEBUG("Creating symlink %s -> %s", src_path.c_str(), dest_path.c_str());
-
if (dirExists(path_sym_link)) { continue; }
// create sym-links
- int ret = symlink(src_path.c_str(), dest_path.c_str());
+ ret = symlink(src_path.c_str(), dest_path.c_str());
if (ret != 0) {
PX4_ERR("Error creating symlink %s -> %s",
@@ -423,8 +429,8 @@ int main(int argc, char **argv)
return ret;
} else {
- PX4_DEBUG("Successfully created symlink %s -> %s",
- src_path.c_str(), dest_path.c_str());
+ PX4_INFO("Successfully created symlink %s -> %s",
+ src_path.c_str(), dest_path.c_str());
}
}
}
diff --git a/src/platforms/posix/px4_layer/CMakeLists.txt b/src/platforms/posix/px4_layer/CMakeLists.txt
index 22459e72f005..1057bf2c7dcd 100644
--- a/src/platforms/posix/px4_layer/CMakeLists.txt
+++ b/src/platforms/posix/px4_layer/CMakeLists.txt
@@ -32,10 +32,10 @@
############################################################################
if("${CONFIG_SHMEM}" STREQUAL "1")
- set(CMAKE_MODULE_PATH ${CMAKE_MODULE_PATH} "${PX4_SOURCE_DIR}/cmake/cmake_hexagon")
+ set(CMAKE_MODULE_PATH ${CMAKE_MODULE_PATH} "${PX4_SOURCE_DIR}/platforms/qurt/cmake/cmake_hexagon")
include(hexagon_sdk)
- include_directories(${PX4_BINARY_DIR}/src/firmware/posix)
+ include_directories(${PX4_BINARY_DIR}/platforms/posix/src/firmware/posix)
include_directories(${HEXAGON_SDK_INCLUDES})
list(APPEND SHMEM_SRCS
shmem_posix.c
diff --git a/src/systemcmds/tests/test_autodeclination.cpp b/src/systemcmds/tests/test_autodeclination.cpp
index 309cd7a85811..ff0873b1be77 100644
--- a/src/systemcmds/tests/test_autodeclination.cpp
+++ b/src/systemcmds/tests/test_autodeclination.cpp
@@ -2,7 +2,9 @@
#include
#include
+#ifdef __PX4_NUTTX
#include
+#endif
#include
#include
diff --git a/src/systemcmds/tests/test_conv.cpp b/src/systemcmds/tests/test_conv.cpp
index fae383c62211..98ed7d07ca38 100644
--- a/src/systemcmds/tests/test_conv.cpp
+++ b/src/systemcmds/tests/test_conv.cpp
@@ -52,7 +52,17 @@
#include
#include
+#ifdef __PX4_NUTTX
#include
+#else
+
+#define REG_TO_SIGNED(_reg) ((int16_t)(_reg))
+#define SIGNED_TO_REG(_signed) ((uint16_t)(_signed))
+
+#define REG_TO_FLOAT(_reg) ((float)REG_TO_SIGNED(_reg) / 10000.0f)
+#define FLOAT_TO_REG(_float) SIGNED_TO_REG((int16_t)floorf((_float + 0.00005f) * 10000.0f))
+
+#endif
int test_conv(int argc, char *argv[])
{
diff --git a/src/systemcmds/tests/test_mixer.cpp b/src/systemcmds/tests/test_mixer.cpp
index 772b37cc5f6c..5370ff7d1df0 100644
--- a/src/systemcmds/tests/test_mixer.cpp
+++ b/src/systemcmds/tests/test_mixer.cpp
@@ -57,8 +57,13 @@
#include
#include
#include
+#ifdef __PX4_NUTTX
#include
#include
+#else
+#define PX4IO_MAX_MIXER_LENGHT 230
+#define PX4IO_MAX_TRANSFER_LEN 64
+#endif
#include
@@ -251,7 +256,7 @@ bool MixerTest::load_mixer(const char *filename, unsigned expected_count, bool v
bool ret = load_mixer(filename, buf, loaded, expected_count, chunk_size, verbose);
if (!ret) {
- PX4_ERR("Mixer load failed with chunk size %u", chunk_size);
+ PX4_ERR("Mixer load failed with chunk size %u: %s", chunk_size, filename);
return ret;
}
}
diff --git a/vendor/ATLFlight/CMakeLists.txt b/vendor/ATLFlight/CMakeLists.txt
new file mode 100644
index 000000000000..e69de29bb2d1
diff --git a/vendor/ATLFlight/multi.conf b/vendor/ATLFlight/multi.conf
new file mode 100644
index 000000000000..6096159b3575
--- /dev/null
+++ b/vendor/ATLFlight/multi.conf
@@ -0,0 +1,4 @@
+eagle_default
+eagle_legacy
+excelsior_default
+excelsior_legacy
diff --git a/cmake/configs/posix_sdflight_default.cmake b/vendor/ATLFlight/posix/cmake/posix_sdflight_default.cmake
similarity index 82%
rename from cmake/configs/posix_sdflight_default.cmake
rename to vendor/ATLFlight/posix/cmake/posix_sdflight_default.cmake
index 72e160431458..e8dff7a9fdb1 100644
--- a/cmake/configs/posix_sdflight_default.cmake
+++ b/vendor/ATLFlight/posix/cmake/posix_sdflight_default.cmake
@@ -7,9 +7,9 @@ else()
set(QC_SOC_TARGET "APQ8074")
endif()
-set(CMAKE_TOOLCHAIN_FILE ${PX4_SOURCE_DIR}/cmake/cmake_hexagon/toolchain/Toolchain-arm-linux-gnueabihf.cmake)
+set(CMAKE_TOOLCHAIN_FILE ${PX4_SOURCE_DIR}/platforms/qurt/cmake/cmake_hexagon/toolchain/Toolchain-arm-linux-gnueabihf.cmake)
-set(CMAKE_MODULE_PATH ${CMAKE_MODULE_PATH} "${PX4_SOURCE_DIR}/cmake/cmake_hexagon")
+set(CMAKE_MODULE_PATH ${CMAKE_MODULE_PATH} "${PX4_SOURCE_DIR}/platforms/qurt/cmake/cmake_hexagon")
# Disable the creation of the parameters.xml file by scanning individual
# source files, and scan all source files. This will create a parameters.xml
@@ -18,13 +18,6 @@ set(CMAKE_MODULE_PATH ${CMAKE_MODULE_PATH} "${PX4_SOURCE_DIR}/cmake/cmake_hexago
# ARM and DSP processors.
set(DISABLE_PARAMS_MODULE_SCOPING TRUE)
-# Get $QC_SOC_TARGET from environment if existing.
-if (DEFINED ENV{QC_SOC_TARGET})
- set(QC_SOC_TARGET $ENV{QC_SOC_TARGET})
-else()
- set(QC_SOC_TARGET "APQ8074")
-endif()
-
set(CONFIG_SHMEM "1")
set(config_module_list
diff --git a/cmake/configs/posix_sdflight_legacy.cmake b/vendor/ATLFlight/posix/cmake/posix_sdflight_legacy.cmake
similarity index 100%
rename from cmake/configs/posix_sdflight_legacy.cmake
rename to vendor/ATLFlight/posix/cmake/posix_sdflight_legacy.cmake
diff --git a/src/drivers/boards/eagle/board_config.h b/vendor/ATLFlight/posix/eagle/board_config.h
similarity index 98%
rename from src/drivers/boards/eagle/board_config.h
rename to vendor/ATLFlight/posix/eagle/board_config.h
index 2c253fb05ac7..8480bde754ad 100644
--- a/src/drivers/boards/eagle/board_config.h
+++ b/vendor/ATLFlight/posix/eagle/board_config.h
@@ -47,4 +47,4 @@
#define BOARD_BATTERY1_A_PER_V (15.391030303f)
#include
-#include "../common/board_common.h"
+#include "common/board_common.h"
diff --git a/cmake/configs/posix_eagle_default.cmake b/vendor/ATLFlight/posix/eagle/config_default.cmake
similarity index 59%
rename from cmake/configs/posix_eagle_default.cmake
rename to vendor/ATLFlight/posix/eagle/config_default.cmake
index be819614250c..5436f5317fec 100644
--- a/cmake/configs/posix_eagle_default.cmake
+++ b/vendor/ATLFlight/posix/eagle/config_default.cmake
@@ -2,11 +2,11 @@
#
# This cmake config builds for POSIX, so the part of the flight stack running
# on the Linux side of the Snapdragon.
-include(configs/posix_sdflight_default)
+include(posix_sdflight_default)
-set(CMAKE_TOOLCHAIN_FILE ${PX4_SOURCE_DIR}/cmake/cmake_hexagon/toolchain/Toolchain-arm-linux-gnueabihf.cmake)
+set(CMAKE_TOOLCHAIN_FILE ${PX4_SOURCE_DIR}/platforms/qurt/cmake/cmake_hexagon/toolchain/Toolchain-arm-linux-gnueabihf.cmake)
-set(CMAKE_MODULE_PATH ${CMAKE_MODULE_PATH} "${PX4_SOURCE_DIR}/cmake/cmake_hexagon")
+set(CMAKE_MODULE_PATH ${CMAKE_MODULE_PATH} "${PX4_SOURCE_DIR}/platforms/qurt/cmake/cmake_hexagon")
set(CONFIG_SHMEM "1")
diff --git a/cmake/configs/posix_eagle_hil.cmake b/vendor/ATLFlight/posix/eagle/config_hil.cmake
similarity index 100%
rename from cmake/configs/posix_eagle_hil.cmake
rename to vendor/ATLFlight/posix/eagle/config_hil.cmake
diff --git a/cmake/configs/posix_eagle_legacy.cmake b/vendor/ATLFlight/posix/eagle/config_legacy.cmake
similarity index 100%
rename from cmake/configs/posix_eagle_legacy.cmake
rename to vendor/ATLFlight/posix/eagle/config_legacy.cmake
diff --git a/cmake/configs/posix_eagle_muorb.cmake b/vendor/ATLFlight/posix/eagle/config_muorb.cmake
similarity index 100%
rename from cmake/configs/posix_eagle_muorb.cmake
rename to vendor/ATLFlight/posix/eagle/config_muorb.cmake
diff --git a/src/drivers/boards/excelsior/board_config.h b/vendor/ATLFlight/posix/excelsior/board_config.h
similarity index 100%
rename from src/drivers/boards/excelsior/board_config.h
rename to vendor/ATLFlight/posix/excelsior/board_config.h
diff --git a/cmake/configs/posix_excelsior_default.cmake b/vendor/ATLFlight/posix/excelsior/config_default.cmake
similarity index 100%
rename from cmake/configs/posix_excelsior_default.cmake
rename to vendor/ATLFlight/posix/excelsior/config_default.cmake
diff --git a/cmake/configs/posix_excelsior_legacy.cmake b/vendor/ATLFlight/posix/excelsior/config_legacy.cmake
similarity index 100%
rename from cmake/configs/posix_excelsior_legacy.cmake
rename to vendor/ATLFlight/posix/excelsior/config_legacy.cmake
diff --git a/cmake/configs/qurt_sdflight_default.cmake b/vendor/ATLFlight/qurt/cmake/qurt_sdflight_default.cmake
similarity index 95%
rename from cmake/configs/qurt_sdflight_default.cmake
rename to vendor/ATLFlight/qurt/cmake/qurt_sdflight_default.cmake
index a1b65c01f824..d6ff13039135 100644
--- a/cmake/configs/qurt_sdflight_default.cmake
+++ b/vendor/ATLFlight/qurt/cmake/qurt_sdflight_default.cmake
@@ -22,7 +22,7 @@ endif()
# ARM and DSP processors.
set(DISABLE_PARAMS_MODULE_SCOPING TRUE)
-set(CMAKE_MODULE_PATH ${CMAKE_MODULE_PATH} "${PX4_SOURCE_DIR}/cmake/cmake_hexagon")
+set(CMAKE_MODULE_PATH ${CMAKE_MODULE_PATH} "${PX4_SOURCE_DIR}/platforms/qurt/cmake/cmake_hexagon")
include(toolchain/Toolchain-qurt)
include(qurt_flags)
include_directories(${HEXAGON_SDK_INCLUDES})
diff --git a/cmake/configs/qurt_sdflight_legacy.cmake b/vendor/ATLFlight/qurt/cmake/qurt_sdflight_legacy.cmake
similarity index 100%
rename from cmake/configs/qurt_sdflight_legacy.cmake
rename to vendor/ATLFlight/qurt/cmake/qurt_sdflight_legacy.cmake
diff --git a/vendor/ATLFlight/qurt/eagle/board_config.h b/vendor/ATLFlight/qurt/eagle/board_config.h
new file mode 100644
index 000000000000..8480bde754ad
--- /dev/null
+++ b/vendor/ATLFlight/qurt/eagle/board_config.h
@@ -0,0 +1,50 @@
+/****************************************************************************
+ *
+ * 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.
+ *
+ ****************************************************************************/
+
+/**
+ * @file board_config.h
+ *
+ * EAGLE internal definitions
+ */
+
+#pragma once
+
+#define BOARD_OVERRIDE_UUID "EAGLEID " // must be of length 12 (PX4_CPU_UUID_BYTE_LENGTH)
+#define BOARD_OVERRIDE_MFGUID BOARD_OVERRIDE_UUID
+
+#define BOARD_NAME "EAGLE"
+#define BOARD_BATTERY1_V_DIV (10.177939394f)
+#define BOARD_BATTERY1_A_PER_V (15.391030303f)
+
+#include
+#include "common/board_common.h"
diff --git a/cmake/configs/qurt_eagle_default.cmake b/vendor/ATLFlight/qurt/eagle/config_default.cmake
similarity index 89%
rename from cmake/configs/qurt_eagle_default.cmake
rename to vendor/ATLFlight/qurt/eagle/config_default.cmake
index 31c112d972da..6af8be4339fd 100644
--- a/cmake/configs/qurt_eagle_default.cmake
+++ b/vendor/ATLFlight/qurt/eagle/config_default.cmake
@@ -4,7 +4,7 @@
# the DSP side.
# The config between different QURT builds is shared.
-include(configs/qurt_sdflight_default)
+include(qurt_sdflight_default)
# This definition allows to differentiate the specific board.
add_definitions(
diff --git a/cmake/configs/qurt_eagle_hello.cmake b/vendor/ATLFlight/qurt/eagle/config_hello.cmake
similarity index 100%
rename from cmake/configs/qurt_eagle_hello.cmake
rename to vendor/ATLFlight/qurt/eagle/config_hello.cmake
diff --git a/cmake/configs/qurt_eagle_hil.cmake b/vendor/ATLFlight/qurt/eagle/config_hil.cmake
similarity index 100%
rename from cmake/configs/qurt_eagle_hil.cmake
rename to vendor/ATLFlight/qurt/eagle/config_hil.cmake
diff --git a/cmake/configs/qurt_eagle_legacy.cmake b/vendor/ATLFlight/qurt/eagle/config_legacy.cmake
similarity index 100%
rename from cmake/configs/qurt_eagle_legacy.cmake
rename to vendor/ATLFlight/qurt/eagle/config_legacy.cmake
diff --git a/cmake/configs/qurt_eagle_muorb.cmake b/vendor/ATLFlight/qurt/eagle/config_muorb.cmake
similarity index 100%
rename from cmake/configs/qurt_eagle_muorb.cmake
rename to vendor/ATLFlight/qurt/eagle/config_muorb.cmake
diff --git a/cmake/configs/qurt_eagle_travis.cmake b/vendor/ATLFlight/qurt/eagle/config_travis.cmake
similarity index 100%
rename from cmake/configs/qurt_eagle_travis.cmake
rename to vendor/ATLFlight/qurt/eagle/config_travis.cmake
diff --git a/cmake/configs/qurt_eagle_test.cmake b/vendor/ATLFlight/qurt/eagle/qurt_eagle_test.cmake
similarity index 100%
rename from cmake/configs/qurt_eagle_test.cmake
rename to vendor/ATLFlight/qurt/eagle/qurt_eagle_test.cmake
diff --git a/vendor/ATLFlight/qurt/excelsior/board_config.h b/vendor/ATLFlight/qurt/excelsior/board_config.h
new file mode 100644
index 000000000000..2b0646b700f5
--- /dev/null
+++ b/vendor/ATLFlight/qurt/excelsior/board_config.h
@@ -0,0 +1,45 @@
+/****************************************************************************
+ *
+ * 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.
+ *
+ ****************************************************************************/
+
+/**
+ * @file board_config.h
+ *
+ * EXCELSIOR internal definitions
+ */
+
+#pragma once
+#define BOARD_NAME "EXCELSIOR"
+#define BOARD_BATTERY1_V_DIV (10.177939394f)
+#define BOARD_BATTERY1_A_PER_V (15.391030303f)
+#define BOARD_HAS_NO_RESET
+#define BOARD_HAS_NO_BOOTLOADER
diff --git a/cmake/configs/qurt_excelsior_default.cmake b/vendor/ATLFlight/qurt/excelsior/config_default.cmake
similarity index 100%
rename from cmake/configs/qurt_excelsior_default.cmake
rename to vendor/ATLFlight/qurt/excelsior/config_default.cmake
diff --git a/cmake/configs/qurt_excelsior_legacy.cmake b/vendor/ATLFlight/qurt/excelsior/config_legacy.cmake
similarity index 100%
rename from cmake/configs/qurt_excelsior_legacy.cmake
rename to vendor/ATLFlight/qurt/excelsior/config_legacy.cmake