mirror of
https://gitee.com/mirrors_PX4/PX4-Autopilot.git
synced 2026-10-21 02:43:33 +08:00
cmake use standard mechanisms for settings flags
This commit is contained in:
committed by
David Sidrane
parent
11be2b8873
commit
3e0a3559a9
@@ -15,10 +15,10 @@
|
||||
#include <lib/rc/sumd.h>
|
||||
#include <lib/rc/crsf.h>
|
||||
|
||||
#if !defined(CONFIG_ARCH_BOARD_SITL)
|
||||
#define TEST_DATA_PATH "/fs/microsd"
|
||||
#else
|
||||
#if defined(CONFIG_ARCH_BOARD_PX4_SITL)
|
||||
#define TEST_DATA_PATH "./test_data/"
|
||||
#else
|
||||
#define TEST_DATA_PATH "/fs/microsd"
|
||||
#endif
|
||||
|
||||
extern "C" __EXPORT int rc_tests_main(int argc, char *argv[]);
|
||||
|
||||
@@ -76,8 +76,6 @@ endif()
|
||||
|
||||
add_library(version version.c)
|
||||
|
||||
string(TOUPPER "${PX4_BOARD}" PX4_BOARD_NAME)
|
||||
|
||||
target_compile_definitions(version
|
||||
PUBLIC
|
||||
PX4_BOARD_NAME="${PX4_BOARD_NAME}"
|
||||
|
||||
@@ -665,7 +665,7 @@ void Logger::add_default_topics()
|
||||
add_topic("vtol_vehicle_status", 200);
|
||||
add_topic("wind_estimate", 200);
|
||||
|
||||
#ifdef CONFIG_ARCH_BOARD_SITL
|
||||
#ifdef CONFIG_ARCH_BOARD_PX4_SITL
|
||||
add_topic("actuator_armed");
|
||||
add_topic("actuator_controls_virtual_fw");
|
||||
add_topic("actuator_controls_virtual_mc");
|
||||
@@ -681,7 +681,7 @@ void Logger::add_default_topics()
|
||||
add_topic("vehicle_global_position_groundtruth", 100);
|
||||
add_topic("vehicle_local_position_groundtruth", 100);
|
||||
add_topic("vehicle_roi");
|
||||
#endif
|
||||
#endif /* CONFIG_ARCH_BOARD_PX4_SITL */
|
||||
}
|
||||
|
||||
void Logger::add_high_rate_topics()
|
||||
|
||||
@@ -1337,7 +1337,7 @@ void Mavlink::send_autopilot_capabilites()
|
||||
memcpy(&msg.uid2, &px4_guid, sizeof(msg.uid2));
|
||||
#endif /* BOARD_HAS_NO_UUID */
|
||||
|
||||
#ifdef CONFIG_ARCH_BOARD_SITL
|
||||
#ifdef CONFIG_ARCH_BOARD_PX4_SITL
|
||||
// To avoid that multiple SITL instances have the same UUID, we add the mavlink
|
||||
// system ID. We subtract 1, so that the first UUID remains unchanged given the
|
||||
// default system ID is 1.
|
||||
@@ -1345,7 +1345,7 @@ void Mavlink::send_autopilot_capabilites()
|
||||
// Note that the UUID show in `ver` will still be the same for all instances.
|
||||
msg.uid += mavlink_system.sysid - 1;
|
||||
msg.uid2[0] += mavlink_system.sysid - 1;
|
||||
#endif
|
||||
#endif /* CONFIG_ARCH_BOARD_PX4_SITL */
|
||||
mavlink_msg_autopilot_version_send_struct(get_channel(), &msg);
|
||||
}
|
||||
}
|
||||
|
||||
@@ -145,6 +145,7 @@ if (GENERATE_RTPS_BRIDGE)
|
||||
git_micro_cdr
|
||||
microcdr
|
||||
)
|
||||
add_dependencies(microcdr prebuild_targets)
|
||||
|
||||
# microCDR
|
||||
target_include_directories(uorb_msgs_microcdr
|
||||
|
||||
@@ -1022,7 +1022,7 @@ void VotedSensorsUpdate::print_status()
|
||||
bool
|
||||
VotedSensorsUpdate::apply_gyro_calibration(DevHandle &h, const struct gyro_calibration_s *gcal, const int device_id)
|
||||
{
|
||||
#if !defined(__PX4_QURT) && !defined(__PX4_POSIX_RPI) && !defined(__PX4_POSIX_BEBOP) && !defined(__PX4_POSIX_BBBLUE)
|
||||
#if defined(__PX4_NUTTX)
|
||||
|
||||
/* On most systems, we can just use the IOCTL call to set the calibration params. */
|
||||
return !h.ioctl(GYROIOCSSCALE, (long unsigned int)gcal);
|
||||
@@ -1036,7 +1036,7 @@ VotedSensorsUpdate::apply_gyro_calibration(DevHandle &h, const struct gyro_calib
|
||||
bool
|
||||
VotedSensorsUpdate::apply_accel_calibration(DevHandle &h, const struct accel_calibration_s *acal, const int device_id)
|
||||
{
|
||||
#if !defined(__PX4_QURT) && !defined(__PX4_POSIX_RPI) && !defined(__PX4_POSIX_BEBOP) && !defined(__PX4_POSIX_BBBLUE)
|
||||
#if defined(__PX4_NUTTX)
|
||||
|
||||
/* On most systems, we can just use the IOCTL call to set the calibration params. */
|
||||
return !h.ioctl(ACCELIOCSSCALE, (long unsigned int)acal);
|
||||
@@ -1050,7 +1050,7 @@ VotedSensorsUpdate::apply_accel_calibration(DevHandle &h, const struct accel_cal
|
||||
bool
|
||||
VotedSensorsUpdate::apply_mag_calibration(DevHandle &h, const struct mag_calibration_s *mcal, const int device_id)
|
||||
{
|
||||
#if !defined(__PX4_QURT) && !defined(__PX4_POSIX)
|
||||
#if defined(__PX4_NUTTX)
|
||||
|
||||
if (!h.isValid()) {
|
||||
return false;
|
||||
|
||||
@@ -79,7 +79,7 @@ static bool should_prearm = false;
|
||||
#endif
|
||||
#endif
|
||||
|
||||
#if defined(CONFIG_ARCH_BOARD_SITL)
|
||||
#if defined(CONFIG_ARCH_BOARD_PX4_SITL)
|
||||
#define MIXER_PATH(_file) "etc/mixers/"#_file
|
||||
#define MIXER_ONBOARD_PATH "etc/mixers"
|
||||
#else
|
||||
|
||||
Reference in New Issue
Block a user