mirror of
https://gitee.com/mirrors_PX4/PX4-Autopilot.git
synced 2026-10-20 03:23:35 +08:00
Cleanup of module building.
This commit is contained in:
@@ -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
|
||||
|
||||
|
||||
Reference in New Issue
Block a user