diff --git a/libraries/AP_NavEKF/AP_NavEKF_Source.cpp b/libraries/AP_NavEKF/AP_NavEKF_Source.cpp index 0f80af9f69..2805bb81fb 100644 --- a/libraries/AP_NavEKF/AP_NavEKF_Source.cpp +++ b/libraries/AP_NavEKF/AP_NavEKF_Source.cpp @@ -153,12 +153,14 @@ void AP_NavEKF_Source::setPosVelYawSourceSet(uint8_t source_set_idx) // sanity check source idx if (source_set_idx < AP_NAKEKF_SOURCE_SET_MAX) { active_source_set = source_set_idx; +#if HAL_LOGGING_ENABLED static const LogEvent evt[AP_NAKEKF_SOURCE_SET_MAX] { LogEvent::EK3_SOURCES_SET_TO_PRIMARY, LogEvent::EK3_SOURCES_SET_TO_SECONDARY, LogEvent::EK3_SOURCES_SET_TO_TERTIARY, }; AP::logger().Write_Event(evt[active_source_set]); +#endif } } diff --git a/libraries/AP_NavEKF/EKFGSF_Logging.cpp b/libraries/AP_NavEKF/EKFGSF_Logging.cpp index 64673085ce..68e57afa7b 100644 --- a/libraries/AP_NavEKF/EKFGSF_Logging.cpp +++ b/libraries/AP_NavEKF/EKFGSF_Logging.cpp @@ -2,6 +2,8 @@ #include +#if HAL_LOGGING_ENABLED + #pragma GCC diagnostic ignored "-Wnarrowing" 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)); } + +#endif // HAL_LOGGING_ENABLED