From dd96d7c2059ab465362de050fa594b324b9fc543 Mon Sep 17 00:00:00 2001 From: Andrew Tridgell Date: Sat, 7 Nov 2020 19:28:21 +1100 Subject: [PATCH] AP_DAL: fixed standalone linking --- libraries/AP_DAL/AP_DAL.cpp | 2 +- libraries/AP_DAL/examples/AP_DAL_Standalone/main.cpp | 10 +++++++--- .../AP_DAL/examples/AP_DAL_Standalone/nobuild.txt | 0 3 files changed, 8 insertions(+), 4 deletions(-) create mode 100644 libraries/AP_DAL/examples/AP_DAL_Standalone/nobuild.txt diff --git a/libraries/AP_DAL/AP_DAL.cpp b/libraries/AP_DAL/AP_DAL.cpp index 3c32234a53..fd89b4a978 100644 --- a/libraries/AP_DAL/AP_DAL.cpp +++ b/libraries/AP_DAL/AP_DAL.cpp @@ -247,7 +247,7 @@ bool AP_DAL::ekf_low_time_remaining(EKFType etype, uint8_t core) { static_assert(INS_MAX_INSTANCES <= 4, "max 4 IMUs"); const uint8_t mask = (1U<<(core+(uint8_t(etype)*4))); -#if !APM_BUILD_TYPE(APM_BUILD_Replay) +#if !APM_BUILD_TYPE(APM_BUILD_AP_DAL_Standalone) && !APM_BUILD_TYPE(APM_BUILD_Replay) /* if we have used more than 1/3 of the time for a loop then we return true, indicating that we are low on CPU. This changes the diff --git a/libraries/AP_DAL/examples/AP_DAL_Standalone/main.cpp b/libraries/AP_DAL/examples/AP_DAL_Standalone/main.cpp index 0940deff9e..a88187b27b 100644 --- a/libraries/AP_DAL/examples/AP_DAL_Standalone/main.cpp +++ b/libraries/AP_DAL/examples/AP_DAL_Standalone/main.cpp @@ -4,14 +4,12 @@ // #include - #include - #include void AP_Param::setup_object_defaults(void const*, AP_Param::GroupInfo const*) {} -int AP_HAL::Util::vsnprintf(char*, unsigned long, char const*, va_list) { return -1; } +int AP_HAL::Util::vsnprintf(char*, size_t, char const*, va_list) { return -1; } void *nologger = nullptr; AP_Logger &AP::logger() { @@ -54,14 +52,20 @@ public: AP_HAL_DAL_Standalone _hal; const AP_HAL::HAL &hal = _hal; +#ifdef HAL_NO_GCS NavEKF2 navekf2; NavEKF3 navekf3; +#endif int main(int argc, const char *argv[]) { +#ifdef HAL_NO_GCS navekf2.InitialiseFilter(); navekf3.InitialiseFilter(); navekf2.UpdateFilter(); navekf3.UpdateFilter(); return navekf2.healthy() && navekf3.healthy()?0:1; +#else + return 0; +#endif } diff --git a/libraries/AP_DAL/examples/AP_DAL_Standalone/nobuild.txt b/libraries/AP_DAL/examples/AP_DAL_Standalone/nobuild.txt new file mode 100644 index 0000000000..e69de29bb2