mirror of
https://gitee.com/mirrors_PX4/PX4-Autopilot.git
synced 2026-10-18 07:43:33 +08:00
Cleanup of module building.
This commit is contained in:
@@ -1,9 +0,0 @@
|
||||
add_subdirectory(./lib)
|
||||
add_subdirectory(./drivers)
|
||||
add_subdirectory(./platforms)
|
||||
add_subdirectory(./systemcmds)
|
||||
add_subdirectory(./examples)
|
||||
add_subdirectory(./modules)
|
||||
add_subdirectory(./firmware/${OS})
|
||||
|
||||
# vim: set noet ft=cmake fenc=utf-8 ff=unix :
|
||||
@@ -1,55 +0,0 @@
|
||||
set(directories
|
||||
./roboclaw
|
||||
./device
|
||||
./px4io
|
||||
./boards/px4fmu-v2
|
||||
./boards/px4-stm32f4discovery
|
||||
./boards/px4io-v2
|
||||
./boards/px4io-v1
|
||||
./boards/px4fmu-v1
|
||||
./boards/aerocore
|
||||
./boards/sitl
|
||||
./mpu6000
|
||||
./gimbal
|
||||
./camera_trigger
|
||||
./pwm_input
|
||||
./pwm_out_sim
|
||||
./pca9685
|
||||
./mkblctrl
|
||||
./sf0x
|
||||
./hott/hott_telemetry
|
||||
./hott/hott_sensors
|
||||
./hott
|
||||
./ms5611
|
||||
./led
|
||||
./irlock
|
||||
./bma180
|
||||
./l3gd20
|
||||
./blinkm
|
||||
./md25
|
||||
./lsm303d
|
||||
./pca8574
|
||||
./mb12xx
|
||||
./trone
|
||||
./airspeed
|
||||
./rgbled
|
||||
./frsky_telemetry
|
||||
./meas_airspeed
|
||||
./px4flow
|
||||
./mpu9250
|
||||
./gps
|
||||
./ets_airspeed
|
||||
./ll40ls
|
||||
./ardrone_interface
|
||||
./hmc5883
|
||||
./px4fmu
|
||||
./stm32/tone_alarm
|
||||
./stm32/adc
|
||||
./stm32
|
||||
./oreoled
|
||||
./batt_smbus
|
||||
)
|
||||
|
||||
foreach(directory ${directories})
|
||||
add_subdirectory(${directory} EXCLUDE_FROM_ALL)
|
||||
endforeach()
|
||||
@@ -35,13 +35,17 @@ set(SRCS)
|
||||
|
||||
if(${OS} STREQUAL "nuttx")
|
||||
list(APPEND SRCS
|
||||
device_nuttx.cpp
|
||||
cdev.cpp
|
||||
i2c_nuttx.cpp
|
||||
pio.cpp
|
||||
spi.cpp
|
||||
ringbuffer.cpp
|
||||
)
|
||||
if (NOT ${BOARD} STREQUAL "sim")
|
||||
list(APPEND SRCS
|
||||
device_nuttx.cpp
|
||||
cdev.cpp
|
||||
i2c_nuttx.cpp
|
||||
pio.cpp
|
||||
spi.cpp
|
||||
)
|
||||
endif()
|
||||
else()
|
||||
list(APPEND SRCS
|
||||
device_posix.cpp
|
||||
|
||||
@@ -1,16 +0,0 @@
|
||||
set(directories
|
||||
./px4_simple_app
|
||||
./fixedwing_control
|
||||
./rover_steering_control
|
||||
./px4_mavlink_debug
|
||||
./px4_daemon_app
|
||||
./flow_position_estimator
|
||||
./matlab_csv_serial
|
||||
./subscriber
|
||||
./hwtest
|
||||
./publisher
|
||||
)
|
||||
|
||||
foreach(directory ${directories})
|
||||
add_subdirectory(${directory} EXCLUDE_FROM_ALL)
|
||||
endforeach()
|
||||
@@ -1,30 +1,29 @@
|
||||
# a list of modules that will be linked to main
|
||||
set(module_list)
|
||||
set(module_list
|
||||
platforms__nuttx
|
||||
platforms__nuttx__px4_layer
|
||||
platforms__common
|
||||
drivers__led
|
||||
drivers__device
|
||||
modules__systemlib
|
||||
modules__uORB
|
||||
)
|
||||
|
||||
if (${LABEL} STREQUAL "simple")
|
||||
list(APPEND module_list
|
||||
drivers__led
|
||||
drivers__device
|
||||
platforms__common
|
||||
modules__systemlib
|
||||
modules__uORB
|
||||
examples__px4_simple_app
|
||||
lib__mathlib__math__filter
|
||||
lib__conversion
|
||||
)
|
||||
endif()
|
||||
|
||||
if (${LABEL} STREQUAL "simple")
|
||||
list(APPEND module_list ${module_list_simple})
|
||||
if(${BOARD} STREQUAL "px4fmu-v2")
|
||||
list(APPEND module_list
|
||||
drivers__boards__px4fmu-v2
|
||||
drivers__stm32
|
||||
lib__mathlib__math__filter
|
||||
lib__conversion
|
||||
)
|
||||
endif()
|
||||
|
||||
list(APPEND module_list
|
||||
platforms__nuttx
|
||||
platforms__nuttx__px4_layer
|
||||
drivers__boards__px4fmu-v2
|
||||
drivers__stm32
|
||||
)
|
||||
|
||||
px4_nuttx_generate_builtin_commands(
|
||||
OUT builtin_commands.c
|
||||
MODULE_LIST ${module_list})
|
||||
|
||||
@@ -1,21 +1,8 @@
|
||||
include(px4_base)
|
||||
|
||||
set(module_dir_list)
|
||||
set(module_list)
|
||||
px4_posix_add_modules(module_dir_list ${BOARD})
|
||||
message(STATUS "module list: ${module_dir_list}")
|
||||
|
||||
include_directories(${CMAKE_CURRENT_BINARY_DIR})
|
||||
|
||||
foreach(directory ${module_dir_list})
|
||||
message(STATUS "directory: ${directory}")
|
||||
px4_mangle_name(${directory} mangled_name)
|
||||
list(APPEND module_list
|
||||
${mangled_name})
|
||||
endforeach()
|
||||
px4_posix_generate_builtin_commands(
|
||||
OUT apps.h
|
||||
MODULE_LIST ${module_list})
|
||||
MODULE_LIST ${module_libraries})
|
||||
|
||||
add_executable(mainapp
|
||||
${CMAKE_SOURCE_DIR}/src/platforms/posix/main.cpp
|
||||
@@ -30,7 +17,7 @@ set_target_properties(mainapp PROPERTIES LINK_FLAGS ${main_link_flags})
|
||||
|
||||
target_link_libraries(mainapp
|
||||
-Wl,--start-group
|
||||
${module_list}
|
||||
${module_libraries}
|
||||
pthread m
|
||||
-Wl,--end-group
|
||||
)
|
||||
|
||||
@@ -1,15 +0,0 @@
|
||||
set(directories
|
||||
./external_lgpl
|
||||
./geo
|
||||
./launchdetection
|
||||
./mathlib/math/filter
|
||||
./mathlib
|
||||
./rc
|
||||
./geo_lookup
|
||||
./ecl
|
||||
./conversion
|
||||
)
|
||||
|
||||
foreach(directory ${directories})
|
||||
add_subdirectory(${directory} EXCLUDE_FROM_ALL)
|
||||
endforeach()
|
||||
@@ -41,6 +41,10 @@
|
||||
#include "LowPassFilter2p.hpp"
|
||||
#include "math.h"
|
||||
|
||||
#ifndef M_PI_F
|
||||
#define M_PI_F 3.14159f
|
||||
#endif
|
||||
|
||||
namespace math
|
||||
{
|
||||
|
||||
|
||||
@@ -1,40 +0,0 @@
|
||||
set(directories
|
||||
./navigator
|
||||
./segway
|
||||
./fw_pos_control_l1
|
||||
./uavcan
|
||||
./position_estimator_inav
|
||||
./px4iofirmware
|
||||
./gpio_led
|
||||
./dataman
|
||||
./fixedwing_backside
|
||||
./uORB
|
||||
./land_detector
|
||||
./muorb/krait
|
||||
./muorb/adsp
|
||||
./simulator
|
||||
./ekf_att_pos_estimator
|
||||
./mc_pos_control
|
||||
./attitude_estimator_ekf
|
||||
./sensors
|
||||
./vtol_att_control
|
||||
./fw_att_control
|
||||
./unit_test
|
||||
./mc_att_control_multiplatform
|
||||
./commander/commander_tests
|
||||
./commander
|
||||
./mavlink/mavlink_tests
|
||||
./mavlink
|
||||
./mc_att_control
|
||||
./bottle_drop
|
||||
./systemlib/mixer
|
||||
./systemlib
|
||||
./mc_pos_control_multiplatform
|
||||
./sdlog2
|
||||
./controllib
|
||||
./attitude_estimator_q
|
||||
)
|
||||
|
||||
foreach(directory ${directories})
|
||||
add_subdirectory(${directory} EXCLUDE_FROM_ALL)
|
||||
endforeach()
|
||||
@@ -62,7 +62,7 @@
|
||||
/** Copy the 96bit MCU Unique ID into the provided pointer */
|
||||
void mcu_unique_id(uint32_t *uid_96_bit)
|
||||
{
|
||||
#ifdef __PX4_NUTTX
|
||||
#ifdef CONFIG_ARCH_CHIP_STM32
|
||||
uid_96_bit[0] = getreg32(UNIQUE_ID);
|
||||
uid_96_bit[1] = getreg32(UNIQUE_ID + 4);
|
||||
uid_96_bit[2] = getreg32(UNIQUE_ID + 8);
|
||||
|
||||
@@ -261,7 +261,11 @@ void print_load(uint64_t t, int fd, struct print_load_s *print_state)
|
||||
stack_size - stack_free,
|
||||
stack_size,
|
||||
system_load.tasks[i].tcb->sched_priority,
|
||||
#if CONFIG_ARCH_BOARD_SIM
|
||||
0);
|
||||
#else
|
||||
system_load.tasks[i].tcb->base_priority);
|
||||
#endif
|
||||
|
||||
#if CONFIG_RR_INTERVAL > 0
|
||||
/* print scheduling info with RR time slice */
|
||||
|
||||
@@ -1,26 +0,0 @@
|
||||
set(directories
|
||||
./posix/tests/hrt_test
|
||||
./posix/tests/wqueue
|
||||
./posix/tests/hello
|
||||
./posix/tests/muorb
|
||||
./posix/tests/vcdev_test
|
||||
./posix/work_queue
|
||||
./posix/px4_layer
|
||||
./posix/drivers/adcsim
|
||||
./posix/drivers/gpssim
|
||||
./posix/drivers/tonealrmsim
|
||||
./posix/drivers/accelsim
|
||||
./posix/drivers/airspeedsim
|
||||
./posix/drivers/barosim
|
||||
./posix/drivers/gyrosim
|
||||
./qurt/tests/hello
|
||||
./qurt/tests/muorb
|
||||
./qurt/px4_layer
|
||||
./common
|
||||
./nuttx/px4_layer
|
||||
./nuttx
|
||||
)
|
||||
|
||||
foreach(directory ${directories})
|
||||
add_subdirectory(${directory} EXCLUDE_FROM_ALL)
|
||||
endforeach()
|
||||
@@ -33,10 +33,11 @@
|
||||
set(depends
|
||||
msg_gen
|
||||
prebuild_targets
|
||||
git_mavlink
|
||||
)
|
||||
|
||||
if(${OS} STREQUAL "posix")
|
||||
list(APPEND depends git_eigen git_mavlink)
|
||||
if(${OS} STREQUAL "posix" OR ${BOARD} STREQUAL "sim")
|
||||
list(APPEND depends git_eigen)
|
||||
endif()
|
||||
|
||||
px4_add_module(
|
||||
|
||||
@@ -50,7 +50,9 @@
|
||||
#include <sys/stat.h>
|
||||
#include <sys/types.h>
|
||||
|
||||
#ifndef CONFIG_ARCH_BOARD_SIM
|
||||
#include <stm32_pwr.h>
|
||||
#endif
|
||||
|
||||
#include <systemlib/systemlib.h>
|
||||
|
||||
@@ -61,7 +63,9 @@ void
|
||||
px4_systemreset(bool to_bootloader)
|
||||
{
|
||||
if (to_bootloader) {
|
||||
#ifndef CONFIG_ARCH_BOARD_SIM
|
||||
stm32_pwr_enablebkp();
|
||||
#endif
|
||||
|
||||
/* XXX wow, this is evil - write a magic number into backup register zero */
|
||||
*(uint32_t *)0x40002850 = 0xb007b007;
|
||||
|
||||
@@ -38,8 +38,10 @@
|
||||
*/
|
||||
#pragma once
|
||||
|
||||
#ifndef CONFIG_ARCH_BOARD_SIM
|
||||
#include <functional>
|
||||
#include <type_traits>
|
||||
#endif
|
||||
|
||||
#if defined(__PX4_ROS)
|
||||
/* includes when building for ros */
|
||||
@@ -219,10 +221,12 @@ public:
|
||||
protected:
|
||||
uORB::SubscriptionBase * _uorb_sub; /**< Handle to the subscription */
|
||||
|
||||
#ifndef CONFIG_ARCH_BOARD_SIM
|
||||
typename std::remove_reference<decltype(((T*)nullptr)->data())>::type getUORBData()
|
||||
{
|
||||
return (typename std::remove_reference<decltype(((T*)nullptr)->data())>::type)*_uorb_sub;
|
||||
}
|
||||
#endif
|
||||
|
||||
/**
|
||||
* Get void pointer to last message value
|
||||
@@ -242,8 +246,13 @@ public:
|
||||
* @param cbf Callback, executed on receiving a new message
|
||||
* @param interval Minimal interval between calls to callback
|
||||
*/
|
||||
SubscriberUORBCallback(unsigned interval,
|
||||
std::function<void(const T &)> cbf) :
|
||||
SubscriberUORBCallback(unsigned interval
|
||||
#ifndef CONFIG_ARCH_BOARD_SIM
|
||||
,std::function<void(const T &)> cbf)
|
||||
#else
|
||||
)
|
||||
#endif
|
||||
:
|
||||
SubscriberUORB<T>(interval),
|
||||
_cbf(cbf)
|
||||
{}
|
||||
@@ -277,7 +286,9 @@ public:
|
||||
};
|
||||
|
||||
protected:
|
||||
#ifndef CONFIG_ARCH_BOARD_SIM
|
||||
std::function<void(const T &)> _cbf; /**< Callback that the user provided on the subscription */
|
||||
#endif
|
||||
};
|
||||
#endif
|
||||
|
||||
|
||||
@@ -1,26 +0,0 @@
|
||||
|
||||
set(directories
|
||||
./mtd
|
||||
./ver
|
||||
./mixer
|
||||
./tests
|
||||
./nshterm
|
||||
./config
|
||||
./top
|
||||
./bl_update
|
||||
./reboot
|
||||
./i2c
|
||||
./param
|
||||
./reflect
|
||||
./usb_connected
|
||||
./motor_test
|
||||
./esc_calib
|
||||
./perf
|
||||
./topic_listener
|
||||
./dumpfile
|
||||
./pwm
|
||||
)
|
||||
|
||||
foreach(directory ${directories})
|
||||
add_subdirectory(${directory} EXCLUDE_FROM_ALL)
|
||||
endforeach()
|
||||
Reference in New Issue
Block a user