diff options
author | Thomas Gubler <thomasgubler@gmail.com> | 2014-12-11 09:27:11 +0100 |
---|---|---|
committer | Thomas Gubler <thomasgubler@gmail.com> | 2014-12-11 09:27:11 +0100 |
commit | a1685ed6d093ec01214e6839ea66f9dd565e55ce (patch) | |
tree | d276f4ea1d2c3e94722a0e69442dab893583cc66 /src | |
parent | d04bbf11ec5d273902d3920981ccac49489d7098 (diff) | |
download | px4-firmware-a1685ed6d093ec01214e6839ea66f9dd565e55ce.tar.gz px4-firmware-a1685ed6d093ec01214e6839ea66f9dd565e55ce.tar.bz2 px4-firmware-a1685ed6d093ec01214e6839ea66f9dd565e55ce.zip |
change definition of px4 main function
Diffstat (limited to 'src')
-rw-r--r-- | src/examples/publisher/publisher_main.cpp | 6 | ||||
-rw-r--r-- | src/examples/subscriber/subscriber_main.cpp | 10 | ||||
-rw-r--r-- | src/platforms/px4_defines.h | 2 |
3 files changed, 9 insertions, 9 deletions
diff --git a/src/examples/publisher/publisher_main.cpp b/src/examples/publisher/publisher_main.cpp index e1034fec5..c4e79aaa6 100644 --- a/src/examples/publisher/publisher_main.cpp +++ b/src/examples/publisher/publisher_main.cpp @@ -49,9 +49,9 @@ bool task_should_exit = false; } using namespace px4; -int publisher_task_main(int argc, char *argv[]); +PX4_MAIN_FUNCTION(publisher); -PX4_MAIN_FUNCTION(publisher) +extern "C" __EXPORT int publisher_main(int argc, char *argv[]) { px4::init(argc, argv, "publisher"); @@ -99,7 +99,7 @@ PX4_MAIN_FUNCTION(publisher) return 1; } -int publisher_task_main(int argc, char *argv[]) +PX4_MAIN_FUNCTION(publisher) { warnx("starting"); PublisherExample p; diff --git a/src/examples/subscriber/subscriber_main.cpp b/src/examples/subscriber/subscriber_main.cpp index 32de4fd6e..0436dc9f2 100644 --- a/src/examples/subscriber/subscriber_main.cpp +++ b/src/examples/subscriber/subscriber_main.cpp @@ -49,12 +49,10 @@ bool task_should_exit = false; } using namespace px4; -int subscriber_task_main(int argc, char *argv[]); +PX4_MAIN_FUNCTION(subscriber); -PX4_MAIN_FUNCTION(subscriber) +extern "C" __EXPORT int subscriber_main(int argc, char *argv[]) { - px4::init(argc, argv, "subscriber"); - if (argc < 1) { errx(1, "usage: subscriber {start|stop|status}"); } @@ -99,8 +97,10 @@ PX4_MAIN_FUNCTION(subscriber) return 1; } -int subscriber_task_main(int argc, char *argv[]) +PX4_MAIN_FUNCTION(subscriber) { + px4::init(argc, argv, "subscriber"); + warnx("starting"); SubscriberExample s; thread_running = true; diff --git a/src/platforms/px4_defines.h b/src/platforms/px4_defines.h index 283dc5a53..440f1b6fc 100644 --- a/src/platforms/px4_defines.h +++ b/src/platforms/px4_defines.h @@ -100,7 +100,7 @@ static inline px4_param_t PX4_ROS_PARAM_SET(const char *name, float value) #include <functional> #endif /* Main entry point */ -#define PX4_MAIN_FUNCTION(_prefix) extern "C" __EXPORT int _prefix##_main(int argc, char *argv[]) +#define PX4_MAIN_FUNCTION(_prefix) int _prefix##_task_main(int argc, char *argv[]) /* Print/output wrappers */ #define PX4_WARN warnx |