diff --git a/libraries/AP_Baro/AP_Baro.cpp b/libraries/AP_Baro/AP_Baro.cpp index 5435ae060c..84bfbadc9f 100644 --- a/libraries/AP_Baro/AP_Baro.cpp +++ b/libraries/AP_Baro/AP_Baro.cpp @@ -874,6 +874,7 @@ void AP_Baro::_probe_i2c_barometers(void) } } +#if HAL_LOGGING_ENABLED bool AP_Baro::should_log() const { AP_Logger *logger = AP_Logger::get_singleton(); @@ -888,6 +889,7 @@ bool AP_Baro::should_log() const } return true; } +#endif /* call update on all drivers diff --git a/libraries/AP_Baro/AP_Baro_Logging.cpp b/libraries/AP_Baro/AP_Baro_Logging.cpp index a697d22661..91c622aaa0 100644 --- a/libraries/AP_Baro/AP_Baro_Logging.cpp +++ b/libraries/AP_Baro/AP_Baro_Logging.cpp @@ -1,3 +1,7 @@ +#include + +#if HAL_LOGGING_ENABLED + #include "AP_Baro.h" #include @@ -44,3 +48,5 @@ void AP_Baro::Write_Baro(void) Write_Baro_instance(time_us, i); } } + +#endif