From e2ad1bbc919143179469e7f6c515fffe5cf0b096 Mon Sep 17 00:00:00 2001 From: Daniel Agar Date: Thu, 9 Jul 2020 17:34:51 -0400 Subject: [PATCH] bmi055: accel periodically read temperature --- src/drivers/imu/bosch/bmi055/BMI055_Accelerometer.cpp | 7 +++++++ 1 file changed, 7 insertions(+) diff --git a/src/drivers/imu/bosch/bmi055/BMI055_Accelerometer.cpp b/src/drivers/imu/bosch/bmi055/BMI055_Accelerometer.cpp index c26c2cf829..14146d06b3 100644 --- a/src/drivers/imu/bosch/bmi055/BMI055_Accelerometer.cpp +++ b/src/drivers/imu/bosch/bmi055/BMI055_Accelerometer.cpp @@ -223,6 +223,13 @@ void BMI055_Accelerometer::RunImpl() perf_count(_bad_register_perf); Reset(); } + + } else { + // periodically update temperature (~1 Hz) + if (hrt_elapsed_time(&_temperature_update_timestamp) >= 1_s) { + UpdateTemperature(); + _temperature_update_timestamp = now; + } } }