forked from Archive/PX4-Autopilot
change definition of px4 main function
This commit is contained in:
parent
d04bbf11ec
commit
a1685ed6d0
|
@ -49,9 +49,9 @@ bool task_should_exit = false;
|
||||||
}
|
}
|
||||||
using namespace px4;
|
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");
|
px4::init(argc, argv, "publisher");
|
||||||
|
|
||||||
|
@ -99,7 +99,7 @@ PX4_MAIN_FUNCTION(publisher)
|
||||||
return 1;
|
return 1;
|
||||||
}
|
}
|
||||||
|
|
||||||
int publisher_task_main(int argc, char *argv[])
|
PX4_MAIN_FUNCTION(publisher)
|
||||||
{
|
{
|
||||||
warnx("starting");
|
warnx("starting");
|
||||||
PublisherExample p;
|
PublisherExample p;
|
||||||
|
|
|
@ -49,12 +49,10 @@ bool task_should_exit = false;
|
||||||
}
|
}
|
||||||
using namespace px4;
|
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) {
|
if (argc < 1) {
|
||||||
errx(1, "usage: subscriber {start|stop|status}");
|
errx(1, "usage: subscriber {start|stop|status}");
|
||||||
}
|
}
|
||||||
|
@ -99,8 +97,10 @@ PX4_MAIN_FUNCTION(subscriber)
|
||||||
return 1;
|
return 1;
|
||||||
}
|
}
|
||||||
|
|
||||||
int subscriber_task_main(int argc, char *argv[])
|
PX4_MAIN_FUNCTION(subscriber)
|
||||||
{
|
{
|
||||||
|
px4::init(argc, argv, "subscriber");
|
||||||
|
|
||||||
warnx("starting");
|
warnx("starting");
|
||||||
SubscriberExample s;
|
SubscriberExample s;
|
||||||
thread_running = true;
|
thread_running = true;
|
||||||
|
|
|
@ -100,7 +100,7 @@ static inline px4_param_t PX4_ROS_PARAM_SET(const char *name, float value)
|
||||||
#include <functional>
|
#include <functional>
|
||||||
#endif
|
#endif
|
||||||
/* Main entry point */
|
/* 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 */
|
/* Print/output wrappers */
|
||||||
#define PX4_WARN warnx
|
#define PX4_WARN warnx
|
||||||
|
|
Loading…
Reference in New Issue