From e546ce39e309624644373dbdd48e8ed1b7c00a21 Mon Sep 17 00:00:00 2001 From: Andrew Tridgell Date: Sat, 2 Nov 2019 13:32:59 +1100 Subject: [PATCH] AP_InertialSensor: updated for heater changes --- libraries/AP_InertialSensor/AP_InertialSensor_Backend.cpp | 8 +++++++- 1 file changed, 7 insertions(+), 1 deletion(-) diff --git a/libraries/AP_InertialSensor/AP_InertialSensor_Backend.cpp b/libraries/AP_InertialSensor/AP_InertialSensor_Backend.cpp index 8f3c47f038..a293c1db5a 100644 --- a/libraries/AP_InertialSensor/AP_InertialSensor_Backend.cpp +++ b/libraries/AP_InertialSensor/AP_InertialSensor_Backend.cpp @@ -2,6 +2,7 @@ #include "AP_InertialSensor.h" #include "AP_InertialSensor_Backend.h" #include +#include #if AP_MODULE_SUPPORTED #include #include @@ -483,10 +484,15 @@ void AP_InertialSensor_Backend::_publish_temperature(uint8_t instance, float tem } _imu._temperature[instance] = temperature; +#if HAL_HAVE_IMU_HEATER /* give the temperature to the control loop in order to keep it constant*/ if (instance == 0) { - hal.util->set_imu_temp(temperature); + AP_BoardConfig *bc = AP::boardConfig(); + if (bc) { + bc->set_imu_temp(temperature); + } } +#endif } /*