diff --git a/libraries/AP_InertialSensor/AP_InertialSensor_Backend.cpp b/libraries/AP_InertialSensor/AP_InertialSensor_Backend.cpp index 3c45c611b1..85c9ed8f34 100644 --- a/libraries/AP_InertialSensor/AP_InertialSensor_Backend.cpp +++ b/libraries/AP_InertialSensor/AP_InertialSensor_Backend.cpp @@ -1,6 +1,7 @@ #define AP_INLINE_VECTOR_OPS #include +#include #include "AP_InertialSensor.h" #include "AP_InertialSensor_Backend.h" #include @@ -816,6 +817,7 @@ void AP_InertialSensor_Backend::update_accel(uint8_t instance) /* front end */ } } +#if HAL_LOGGING_ENABLED bool AP_InertialSensor_Backend::should_log_imu_raw() const { if (_imu._log_raw_bit == (uint32_t)-1) { @@ -831,6 +833,7 @@ bool AP_InertialSensor_Backend::should_log_imu_raw() const } return true; } +#endif // HAL_LOGGING_ENABLED // log an unexpected change in a register for an IMU void AP_InertialSensor_Backend::log_register_change(uint32_t bus_id, const AP_HAL::Device::checkreg ®) diff --git a/libraries/AP_InertialSensor/AP_InertialSensor_Backend.h b/libraries/AP_InertialSensor/AP_InertialSensor_Backend.h index 880571ee4f..e51d9362b8 100644 --- a/libraries/AP_InertialSensor/AP_InertialSensor_Backend.h +++ b/libraries/AP_InertialSensor/AP_InertialSensor_Backend.h @@ -312,7 +312,7 @@ protected: */ void notify_accel_fifo_reset(uint8_t instance) __RAMFUNC__; void notify_gyro_fifo_reset(uint8_t instance) __RAMFUNC__; - + // log an unexpected change in a register for an IMU void log_register_change(uint32_t bus_id, const AP_HAL::Device::checkreg ®) __RAMFUNC__; diff --git a/libraries/AP_InertialSensor/AP_InertialSensor_Logging.cpp b/libraries/AP_InertialSensor/AP_InertialSensor_Logging.cpp index e59019d7de..2318766a67 100644 --- a/libraries/AP_InertialSensor/AP_InertialSensor_Logging.cpp +++ b/libraries/AP_InertialSensor/AP_InertialSensor_Logging.cpp @@ -1,3 +1,7 @@ +#include + +#if HAL_LOGGING_ENABLED + #include "AP_InertialSensor.h" #include "AP_InertialSensor_Backend.h" @@ -188,3 +192,5 @@ void AP_InertialSensor::write_notch_log_messages() const } } } + +#endif // HAL_LOGGING_ENABLED diff --git a/libraries/AP_InertialSensor/AP_InertialSensor_tempcal.cpp b/libraries/AP_InertialSensor/AP_InertialSensor_tempcal.cpp index 486d14965a..ef5062cb93 100644 --- a/libraries/AP_InertialSensor/AP_InertialSensor_tempcal.cpp +++ b/libraries/AP_InertialSensor/AP_InertialSensor_tempcal.cpp @@ -26,6 +26,7 @@ #include #include #include +#include "AP_InertialSensor.h" // this scale factor ensures params are easy to work with in GUI parameter editors #define SCALE_FACTOR 1.0e6