AP_NavEKF: allow compilation with HAL_LOGGING_ENABLED false

This commit is contained in:
Peter Barker 2023-07-14 10:58:07 +10:00 committed by Andrew Tridgell
parent 0afed2f8c2
commit a9b328e4de
2 changed files with 6 additions and 0 deletions

View File

@ -153,12 +153,14 @@ void AP_NavEKF_Source::setPosVelYawSourceSet(uint8_t source_set_idx)
// sanity check source idx // sanity check source idx
if (source_set_idx < AP_NAKEKF_SOURCE_SET_MAX) { if (source_set_idx < AP_NAKEKF_SOURCE_SET_MAX) {
active_source_set = source_set_idx; active_source_set = source_set_idx;
#if HAL_LOGGING_ENABLED
static const LogEvent evt[AP_NAKEKF_SOURCE_SET_MAX] { static const LogEvent evt[AP_NAKEKF_SOURCE_SET_MAX] {
LogEvent::EK3_SOURCES_SET_TO_PRIMARY, LogEvent::EK3_SOURCES_SET_TO_PRIMARY,
LogEvent::EK3_SOURCES_SET_TO_SECONDARY, LogEvent::EK3_SOURCES_SET_TO_SECONDARY,
LogEvent::EK3_SOURCES_SET_TO_TERTIARY, LogEvent::EK3_SOURCES_SET_TO_TERTIARY,
}; };
AP::logger().Write_Event(evt[active_source_set]); AP::logger().Write_Event(evt[active_source_set]);
#endif
} }
} }

View File

@ -2,6 +2,8 @@
#include <AP_Logger/AP_Logger.h> #include <AP_Logger/AP_Logger.h>
#if HAL_LOGGING_ENABLED
#pragma GCC diagnostic ignored "-Wnarrowing" #pragma GCC diagnostic ignored "-Wnarrowing"
void EKFGSF_yaw::Log_Write(uint64_t time_us, LogMessages id0, LogMessages id1, uint8_t core_index) void EKFGSF_yaw::Log_Write(uint64_t time_us, LogMessages id0, LogMessages id1, uint8_t core_index)
@ -48,3 +50,5 @@ void EKFGSF_yaw::Log_Write(uint64_t time_us, LogMessages id0, LogMessages id1, u
}; };
AP::logger().WriteBlock(&ky1, sizeof(ky1)); AP::logger().WriteBlock(&ky1, sizeof(ky1));
} }
#endif // HAL_LOGGING_ENABLED