Cleanup of module building.

This commit is contained in:
James Goppert
2015-09-09 23:00:58 -04:00
parent a529153062
commit bf18c84652
36 changed files with 151 additions and 291 deletions
-26
View File
@@ -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()
+3 -2
View File
@@ -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;
+13 -2
View File
@@ -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