Skip to content

Commit

Permalink
platform: restructure (NuttX) architecture-specific code
Browse files Browse the repository at this point in the history
updated: tone_alarm, px4io_serial, px4_micro_hal
  • Loading branch information
bkueng committed Aug 30, 2019
1 parent 2fa3ee9 commit ab43a83
Show file tree
Hide file tree
Showing 111 changed files with 1,638 additions and 402 deletions.
12 changes: 12 additions & 0 deletions CMakeLists.txt
Original file line number Diff line number Diff line change
Expand Up @@ -347,6 +347,17 @@ else()
px4_find_python_module(jinja2 REQUIRED)
endif()

#=============================================================================
# get chip and chip manufacturer
#
px4_os_determine_build_chip()
if(NOT PX4_CHIP_MANUFACTURER)
message(FATAL_ERROR "px4_os_determine_build_chip() needs to set PX4_CHIP_MANUFACTURER")
endif()
if(NOT PX4_CHIP)
message(FATAL_ERROR "px4_os_determine_build_chip() needs to set PX4_CHIP")
endif()

#=============================================================================
# build flags
#
Expand Down Expand Up @@ -451,6 +462,7 @@ add_library(parameters_interface INTERFACE)
include(px4_add_library)
add_subdirectory(src/lib EXCLUDE_FROM_ALL)

add_subdirectory(platforms/${PX4_PLATFORM}/src/px4)
add_subdirectory(src/platforms EXCLUDE_FROM_ALL)
add_subdirectory(src/modules/uORB EXCLUDE_FROM_ALL) # TODO: platform layer
add_subdirectory(src/drivers/boards EXCLUDE_FROM_ALL)
Expand Down
1 change: 0 additions & 1 deletion boards/airmind/mindpx-v2/default.cmake
Original file line number Diff line number Diff line change
Expand Up @@ -42,7 +42,6 @@ px4_add_board(
rc_input
stm32
stm32/adc
stm32/tone_alarm
tap_esc
telemetry # all available telemetry drivers
test_ppm
Expand Down
1 change: 0 additions & 1 deletion boards/auav/x21/default.cmake
Original file line number Diff line number Diff line change
Expand Up @@ -48,7 +48,6 @@ px4_add_board(
roboclaw
stm32
stm32/adc
stm32/tone_alarm
tap_esc
telemetry # all available telemetry drivers
test_ppm
Expand Down
1 change: 0 additions & 1 deletion boards/av/x-v1/default.cmake
Original file line number Diff line number Diff line change
Expand Up @@ -49,7 +49,6 @@ px4_add_board(
#roboclaw
stm32
stm32/adc
#stm32/tone_alarm
tap_esc
telemetry # all available telemetry drivers
test_ppm
Expand Down
1 change: 0 additions & 1 deletion boards/holybro/kakutef7/default.cmake
Original file line number Diff line number Diff line change
Expand Up @@ -27,7 +27,6 @@ px4_add_board(
rc_input
stm32
stm32/adc
stm32/tone_alarm
telemetry
tone_alarm
osd
Expand Down
1 change: 0 additions & 1 deletion boards/mro/ctrl-zero-f7/default.cmake
Original file line number Diff line number Diff line change
Expand Up @@ -51,7 +51,6 @@ px4_add_board(
safety_button
stm32
stm32/adc
stm32/tone_alarm
tap_esc
telemetry # all available telemetry drivers
test_ppm
Expand Down
1 change: 0 additions & 1 deletion boards/nxp/fmuk66-v3/default.cmake
Original file line number Diff line number Diff line change
Expand Up @@ -32,7 +32,6 @@ px4_add_board(
irlock
kinetis
kinetis/adc
kinetis/tone_alarm
lights/blinkm
lights/oreoled
lights/rgbled
Expand Down
1 change: 0 additions & 1 deletion boards/omnibus/f4sd/default.cmake
Original file line number Diff line number Diff line change
Expand Up @@ -37,7 +37,6 @@ px4_add_board(
rc_input
stm32
stm32/adc
#stm32/tone_alarm
#tap_esc
#telemetry # all available telemetry drivers
telemetry/frsky_telemetry
Expand Down
1 change: 0 additions & 1 deletion boards/px4/fmu-v2/default.cmake
Original file line number Diff line number Diff line change
Expand Up @@ -57,7 +57,6 @@ px4_add_board(
#roboclaw
stm32
stm32/adc
stm32/tone_alarm
#tap_esc
#telemetry # all available telemetry drivers
#test_ppm
Expand Down
1 change: 0 additions & 1 deletion boards/px4/fmu-v2/fixedwing.cmake
Original file line number Diff line number Diff line change
Expand Up @@ -37,7 +37,6 @@ px4_add_board(
px4io
stm32
stm32/adc
stm32/tone_alarm
#telemetry # all available telemetry drivers
telemetry/iridiumsbd
tone_alarm
Expand Down
1 change: 0 additions & 1 deletion boards/px4/fmu-v2/lpe.cmake
Original file line number Diff line number Diff line change
Expand Up @@ -53,7 +53,6 @@ px4_add_board(
px4io
stm32
stm32/adc
stm32/tone_alarm
#tap_esc
#telemetry # all available telemetry drivers
#test_ppm
Expand Down
1 change: 0 additions & 1 deletion boards/px4/fmu-v2/multicopter.cmake
Original file line number Diff line number Diff line change
Expand Up @@ -37,7 +37,6 @@ px4_add_board(
px4io
stm32
stm32/adc
stm32/tone_alarm
tone_alarm

MODULES
Expand Down
1 change: 0 additions & 1 deletion boards/px4/fmu-v2/rover.cmake
Original file line number Diff line number Diff line change
Expand Up @@ -33,7 +33,6 @@ px4_add_board(
px4io
stm32
stm32/adc
stm32/tone_alarm
tone_alarm

MODULES
Expand Down
1 change: 0 additions & 1 deletion boards/px4/fmu-v2/test.cmake
Original file line number Diff line number Diff line change
Expand Up @@ -53,7 +53,6 @@ px4_add_board(
px4io
stm32
stm32/adc
stm32/tone_alarm
#tap_esc
#telemetry # all available telemetry drivers
#test_ppm
Expand Down
1 change: 0 additions & 1 deletion boards/px4/fmu-v3/default.cmake
Original file line number Diff line number Diff line change
Expand Up @@ -56,7 +56,6 @@ px4_add_board(
roboclaw
stm32
stm32/adc
stm32/tone_alarm
tap_esc
telemetry # all available telemetry drivers
test_ppm
Expand Down
1 change: 0 additions & 1 deletion boards/px4/fmu-v3/rtps.cmake
Original file line number Diff line number Diff line change
Expand Up @@ -55,7 +55,6 @@ px4_add_board(
roboclaw
stm32
stm32/adc
stm32/tone_alarm
tap_esc
telemetry # all available telemetry drivers
test_ppm
Expand Down
1 change: 0 additions & 1 deletion boards/px4/fmu-v3/stackcheck.cmake
Original file line number Diff line number Diff line change
Expand Up @@ -55,7 +55,6 @@ px4_add_board(
roboclaw
stm32
stm32/adc
stm32/tone_alarm
tap_esc
telemetry # all available telemetry drivers
test_ppm
Expand Down
1 change: 0 additions & 1 deletion boards/px4/fmu-v4/default.cmake
Original file line number Diff line number Diff line change
Expand Up @@ -41,7 +41,6 @@ px4_add_board(
safety_button
stm32
stm32/adc
stm32/tone_alarm
tap_esc
telemetry # all available telemetry drivers
test_ppm
Expand Down
1 change: 0 additions & 1 deletion boards/px4/fmu-v4/rtps.cmake
Original file line number Diff line number Diff line change
Expand Up @@ -43,7 +43,6 @@ px4_add_board(
safety_button
stm32
stm32/adc
stm32/tone_alarm
tap_esc
telemetry # all available telemetry drivers
test_ppm
Expand Down
1 change: 0 additions & 1 deletion boards/px4/fmu-v4/stackcheck.cmake
Original file line number Diff line number Diff line change
Expand Up @@ -41,7 +41,6 @@ px4_add_board(
safety_button
stm32
stm32/adc
stm32/tone_alarm
tap_esc
telemetry # all available telemetry drivers
test_ppm
Expand Down
1 change: 0 additions & 1 deletion boards/px4/fmu-v4pro/default.cmake
Original file line number Diff line number Diff line change
Expand Up @@ -54,7 +54,6 @@ px4_add_board(
roboclaw
stm32
stm32/adc
stm32/tone_alarm
tap_esc
telemetry # all available telemetry drivers
test_ppm
Expand Down
1 change: 0 additions & 1 deletion boards/px4/fmu-v4pro/rtps.cmake
Original file line number Diff line number Diff line change
Expand Up @@ -53,7 +53,6 @@ px4_add_board(
roboclaw
stm32
stm32/adc
stm32/tone_alarm
tap_esc
telemetry # all available telemetry drivers
test_ppm
Expand Down
1 change: 0 additions & 1 deletion boards/px4/fmu-v5/critmonitor.cmake
Original file line number Diff line number Diff line change
Expand Up @@ -55,7 +55,6 @@ px4_add_board(
safety_button
stm32
stm32/adc
stm32/tone_alarm
tap_esc
telemetry # all available telemetry drivers
test_ppm
Expand Down
1 change: 0 additions & 1 deletion boards/px4/fmu-v5/default.cmake
Original file line number Diff line number Diff line change
Expand Up @@ -55,7 +55,6 @@ px4_add_board(
safety_button
stm32
stm32/adc
stm32/tone_alarm
tap_esc
telemetry # all available telemetry drivers
test_ppm
Expand Down
1 change: 0 additions & 1 deletion boards/px4/fmu-v5/fixedwing.cmake
Original file line number Diff line number Diff line change
Expand Up @@ -39,7 +39,6 @@ px4_add_board(
safety_button
stm32
stm32/adc
stm32/tone_alarm
telemetry # all available telemetry drivers
tone_alarm
uavcan
Expand Down
1 change: 0 additions & 1 deletion boards/px4/fmu-v5/irqmonitor.cmake
Original file line number Diff line number Diff line change
Expand Up @@ -55,7 +55,6 @@ px4_add_board(
safety_button
stm32
stm32/adc
stm32/tone_alarm
tap_esc
telemetry # all available telemetry drivers
test_ppm
Expand Down
1 change: 0 additions & 1 deletion boards/px4/fmu-v5/multicopter.cmake
Original file line number Diff line number Diff line change
Expand Up @@ -43,7 +43,6 @@ px4_add_board(
safety_button
stm32
stm32/adc
stm32/tone_alarm
tap_esc
telemetry # all available telemetry drivers
tone_alarm
Expand Down
1 change: 0 additions & 1 deletion boards/px4/fmu-v5/rover.cmake
Original file line number Diff line number Diff line change
Expand Up @@ -43,7 +43,6 @@ px4_add_board(
safety_button
stm32
stm32/adc
stm32/tone_alarm
telemetry # all available telemetry drivers
tone_alarm
uavcan
Expand Down
1 change: 0 additions & 1 deletion boards/px4/fmu-v5/rtps.cmake
Original file line number Diff line number Diff line change
Expand Up @@ -53,7 +53,6 @@ px4_add_board(
safety_button
stm32
stm32/adc
stm32/tone_alarm
tap_esc
telemetry # all available telemetry drivers
test_ppm
Expand Down
1 change: 0 additions & 1 deletion boards/px4/fmu-v5/stackcheck.cmake
Original file line number Diff line number Diff line change
Expand Up @@ -53,7 +53,6 @@ px4_add_board(
safety_button
stm32
stm32/adc
stm32/tone_alarm
tap_esc
telemetry # all available telemetry drivers
test_ppm
Expand Down
1 change: 0 additions & 1 deletion boards/px4/fmu-v5x/default.cmake
Original file line number Diff line number Diff line change
Expand Up @@ -55,7 +55,6 @@ px4_add_board(
safety_button
stm32
stm32/adc
stm32/tone_alarm
tap_esc
telemetry # all available telemetry drivers
test_ppm
Expand Down
1 change: 0 additions & 1 deletion boards/px4/fmu-v5x/fixedwing.cmake
Original file line number Diff line number Diff line change
Expand Up @@ -49,7 +49,6 @@ px4_add_board(
safety_button
stm32
stm32/adc
stm32/tone_alarm
telemetry # all available telemetry drivers
tone_alarm
uavcan
Expand Down
1 change: 0 additions & 1 deletion boards/px4/fmu-v5x/multicopter.cmake
Original file line number Diff line number Diff line change
Expand Up @@ -50,7 +50,6 @@ px4_add_board(
safety_button
stm32
stm32/adc
stm32/tone_alarm
tap_esc
telemetry # all available telemetry drivers
tone_alarm
Expand Down
1 change: 0 additions & 1 deletion boards/px4/fmu-v5x/rover.cmake
Original file line number Diff line number Diff line change
Expand Up @@ -53,7 +53,6 @@ px4_add_board(
safety_button
stm32
stm32/adc
stm32/tone_alarm
telemetry # all available telemetry drivers
tone_alarm
uavcan
Expand Down
1 change: 0 additions & 1 deletion boards/px4/fmu-v5x/rtps.cmake
Original file line number Diff line number Diff line change
Expand Up @@ -55,7 +55,6 @@ px4_add_board(
safety_button
stm32
stm32/adc
stm32/tone_alarm
tap_esc
telemetry # all available telemetry drivers
test_ppm
Expand Down
1 change: 0 additions & 1 deletion boards/px4/fmu-v5x/stackcheck.cmake
Original file line number Diff line number Diff line change
Expand Up @@ -55,7 +55,6 @@ px4_add_board(
safety_button
stm32
stm32/adc
stm32/tone_alarm
tap_esc
telemetry # all available telemetry drivers
test_ppm
Expand Down
1 change: 0 additions & 1 deletion boards/px4/sitl/default.cmake
Original file line number Diff line number Diff line change
Expand Up @@ -17,7 +17,6 @@ px4_add_board(
#magnetometer # all available magnetometer drivers
pwm_out_sim
#telemetry # all available telemetry drivers
sim/tone_alarm
tone_alarm
#uavcan

Expand Down
1 change: 0 additions & 1 deletion boards/px4/sitl/rtps.cmake
Original file line number Diff line number Diff line change
Expand Up @@ -17,7 +17,6 @@ px4_add_board(
#magnetometer # all available magnetometer drivers
pwm_out_sim
#telemetry # all available telemetry drivers
sim/tone_alarm
tone_alarm
#uavcan

Expand Down
1 change: 0 additions & 1 deletion boards/px4/sitl/test.cmake
Original file line number Diff line number Diff line change
Expand Up @@ -17,7 +17,6 @@ px4_add_board(
#magnetometer # all available magnetometer drivers
pwm_out_sim
#telemetry # all available telemetry drivers
sim/tone_alarm
tone_alarm
#uavcan

Expand Down
1 change: 0 additions & 1 deletion boards/uvify/core/default.cmake
Original file line number Diff line number Diff line change
Expand Up @@ -47,7 +47,6 @@ px4_add_board(
rc_input
stm32
stm32/adc
stm32/tone_alarm
#tap_esc
telemetry # all available telemetry drivers
#test_ppm
Expand Down
3 changes: 3 additions & 0 deletions cmake/px4_add_board.cmake
Original file line number Diff line number Diff line change
Expand Up @@ -183,6 +183,9 @@ function(px4_add_board)
set(PX4_PLATFORM ${PLATFORM} CACHE STRING "PX4 board OS" FORCE)
list(APPEND CMAKE_MODULE_PATH ${PX4_SOURCE_DIR}/platforms/${PX4_PLATFORM}/cmake)

# platform-specific include path
include_directories(${PX4_SOURCE_DIR}/platforms/${PX4_PLATFORM}/src/px4/common/include)

if(ARCHITECTURE)
set(CMAKE_SYSTEM_PROCESSOR ${ARCHITECTURE} CACHE INTERNAL "system processor" FORCE)
endif()
Expand Down
1 change: 1 addition & 0 deletions cmake/px4_add_common_flags.cmake
Original file line number Diff line number Diff line change
Expand Up @@ -174,6 +174,7 @@ function(px4_add_common_flags)
${PX4_BINARY_DIR}/src/lib
${PX4_BINARY_DIR}/src/modules

${PX4_SOURCE_DIR}/platforms/${PX4_PLATFORM}/src/px4/${PX4_CHIP_MANUFACTURER}/${PX4_CHIP}
${PX4_SOURCE_DIR}/src
${PX4_SOURCE_DIR}/src/include
${PX4_SOURCE_DIR}/src/lib
Expand Down
2 changes: 1 addition & 1 deletion cmake/px4_add_library.cmake
Original file line number Diff line number Diff line change
Expand Up @@ -40,7 +40,7 @@ include(px4_base)
# Like add_library but with PX4 platform dependencies
#
function(px4_add_library target)
add_library(${target} ${ARGN})
add_library(${target} EXCLUDE_FROM_ALL ${ARGN})

target_compile_definitions(${target} PRIVATE MODULE_NAME="${target}")

Expand Down
2 changes: 0 additions & 2 deletions platforms/nuttx/CMakeLists.txt
Original file line number Diff line number Diff line change
Expand Up @@ -36,8 +36,6 @@ include(cygwin_cygpath)
set(NUTTX_DIR ${PX4_BINARY_DIR}/NuttX/nuttx)
set(NUTTX_APPS_DIR ${PX4_BINARY_DIR}/NuttX/apps)

add_subdirectory(src)

add_executable(px4 ${PX4_SOURCE_DIR}/src/platforms/empty.c)
set(FW_NAME ${PX4_BOARD_VENDOR}_${PX4_BOARD_MODEL}_${PX4_BOARD_LABEL}.elf)
set_target_properties(px4 PROPERTIES OUTPUT_NAME ${FW_NAME})
Expand Down
Loading

0 comments on commit ab43a83

Please sign in to comment.