diff options
author | Lorenz Meier <lm@inf.ethz.ch> | 2013-04-26 15:13:47 +0200 |
---|---|---|
committer | Lorenz Meier <lm@inf.ethz.ch> | 2013-04-26 15:13:47 +0200 |
commit | afbb4d55b3fc4e0e2a1fc1a1b052e9f4fb034d51 (patch) | |
tree | fbc0ece27d5a77144d9b65c8b049f08591dd9098 | |
parent | ed9fbbce5946d22ded1519ddec1b5ff6a8f2e511 (diff) | |
download | px4-firmware-afbb4d55b3fc4e0e2a1fc1a1b052e9f4fb034d51.tar.gz px4-firmware-afbb4d55b3fc4e0e2a1fc1a1b052e9f4fb034d51.tar.bz2 px4-firmware-afbb4d55b3fc4e0e2a1fc1a1b052e9f4fb034d51.zip |
Finished conversion to C++
-rwxr-xr-x | apps/attitude_estimator_ekf/Makefile | 5 | ||||
-rwxr-xr-x | apps/attitude_estimator_ekf/attitude_estimator_ekf_main.cpp (renamed from apps/attitude_estimator_ekf/attitude_estimator_ekf_main.c) | 17 |
2 files changed, 15 insertions, 7 deletions
diff --git a/apps/attitude_estimator_ekf/Makefile b/apps/attitude_estimator_ekf/Makefile index 734af7cc1..46a54c660 100755 --- a/apps/attitude_estimator_ekf/Makefile +++ b/apps/attitude_estimator_ekf/Makefile @@ -35,8 +35,9 @@ APPNAME = attitude_estimator_ekf PRIORITY = SCHED_PRIORITY_DEFAULT STACKSIZE = 2048 -CSRCS = attitude_estimator_ekf_main.c \ - attitude_estimator_ekf_params.c \ +CXXSRCS = attitude_estimator_ekf_main.cpp + +CSRCS = attitude_estimator_ekf_params.c \ codegen/eye.c \ codegen/attitudeKalmanfilter.c \ codegen/mrdivide.c \ diff --git a/apps/attitude_estimator_ekf/attitude_estimator_ekf_main.c b/apps/attitude_estimator_ekf/attitude_estimator_ekf_main.cpp index bd972f03f..1a50dde0f 100755 --- a/apps/attitude_estimator_ekf/attitude_estimator_ekf_main.c +++ b/apps/attitude_estimator_ekf/attitude_estimator_ekf_main.cpp @@ -66,11 +66,17 @@ #include <systemlib/perf_counter.h> #include <systemlib/err.h> +#ifdef __cplusplus +extern "C" { +#endif #include "codegen/attitudeKalmanfilter_initialize.h" #include "codegen/attitudeKalmanfilter.h" #include "attitude_estimator_ekf_params.h" +#ifdef __cplusplus +} +#endif -__EXPORT int attitude_estimator_ekf_main(int argc, char *argv[]); +extern "C" __EXPORT int attitude_estimator_ekf_main(int argc, char *argv[]); static bool thread_should_exit = false; /**< Deamon exit flag */ static bool thread_running = false; /**< Deamon status flag */ @@ -265,10 +271,11 @@ const unsigned int loop_interval_alarm = 6500; // loop interval in microseconds /* Main loop*/ while (!thread_should_exit) { - struct pollfd fds[2] = { - { .fd = sub_raw, .events = POLLIN }, - { .fd = sub_params, .events = POLLIN } - }; + struct pollfd fds[2]; + fds[0].fd = sub_raw; + fds[0].events = POLLIN; + fds[1].fd = sub_params; + fds[1].events = POLLIN; int ret = poll(fds, 2, 1000); if (ret < 0) { |