From 78b899c72d99fd53f6cf77a66234f159bb052846 Mon Sep 17 00:00:00 2001 From: Freek van Tienen Date: Tue, 5 Mar 2019 18:41:21 +0100 Subject: [PATCH] Add Paparazzi compatibility (#580) This adds support for the paparazzi autopilot to use this library as EKF. The header order change has to be done in order to have std.h included to get certain defines at the start of the estimator_interface.h. --- EKF/estimator_interface.h | 2 +- ecl.h | 13 +++++++++++++ 2 files changed, 14 insertions(+), 1 deletion(-) diff --git a/EKF/estimator_interface.h b/EKF/estimator_interface.h index e37755886e..1d7eb16793 100644 --- a/EKF/estimator_interface.h +++ b/EKF/estimator_interface.h @@ -41,10 +41,10 @@ #pragma once +#include #include "common.h" #include "RingBuffer.h" -#include #include #include #include diff --git a/ecl.h b/ecl.h index 1984fac8be..d9244ef129 100644 --- a/ecl.h +++ b/ecl.h @@ -51,6 +51,19 @@ using ecl_abstime = hrt_abstime; #define ECL_WARN PX4_WARN #define ECL_ERR PX4_ERR +#elif defined(__PAPARAZZI) + +#include "std.h" + +#define ecl_absolute_time() (0) +#define ecl_elapsed_time(t) (*t * 0UL) // TODO: add simple time functions + +using ecl_abstime = uint64_t; + +#define ECL_INFO(...) +#define ECL_WARN(...) +#define ECL_ERR(...) + #else #include