GCS_Common: Fix issue #19599 Failed to build Pixhawk1 with O3

This commit is contained in:
Jaaaky 2022-01-13 18:50:38 +03:00 committed by Andrew Tridgell
parent f80a9ba3ce
commit 20b3add9fb
1 changed files with 3 additions and 1 deletions

View File

@ -1769,11 +1769,13 @@ void GCS_MAVLINK::send_scaled_imu(uint8_t instance, void (*send_fn)(mavlink_chan
#if HAL_INS_ENABLED
const AP_InertialSensor &ins = AP::ins();
const Compass &compass = AP::compass();
int16_t _temperature = 0;
bool have_data = false;
Vector3f accel{};
if (ins.get_accel_count() > instance) {
accel = ins.get_accel(instance);
_temperature = ins.get_temperature(instance)*100;
have_data = true;
}
Vector3f gyro{};
@ -1801,7 +1803,7 @@ void GCS_MAVLINK::send_scaled_imu(uint8_t instance, void (*send_fn)(mavlink_chan
mag.x,
mag.y,
mag.z,
int16_t(ins.get_temperature(instance)*100));
_temperature);
#endif
}