From 4fdbbd89840cef2f54eb52a73e34a6927d10ce86 Mon Sep 17 00:00:00 2001 From: Andrew Tridgell Date: Fri, 27 Nov 2020 09:37:13 +1100 Subject: [PATCH] AP_NavEKF: added functions to see if a nav source is enabled this allows us to avoid initialising ring buffers when not needed --- libraries/AP_NavEKF/AP_NavEKF_Source.cpp | 47 ++++++++++++++++++++++++ libraries/AP_NavEKF/AP_NavEKF_Source.h | 11 +++++- 2 files changed, 57 insertions(+), 1 deletion(-) diff --git a/libraries/AP_NavEKF/AP_NavEKF_Source.cpp b/libraries/AP_NavEKF/AP_NavEKF_Source.cpp index d29d370aef..1d5294b163 100644 --- a/libraries/AP_NavEKF/AP_NavEKF_Source.cpp +++ b/libraries/AP_NavEKF/AP_NavEKF_Source.cpp @@ -477,3 +477,50 @@ bool AP_NavEKF_Source::pre_arm_check(char *failure_msg, uint8_t failure_msg_len) return true; } + +// return true if ext nav is enabled on any source +bool AP_NavEKF_Source::ext_nav_enabled(void) const +{ + for (uint8_t i=0; i