From 2c95093d361ea8e4ab156e7bb6f531264f6c6d22 Mon Sep 17 00:00:00 2001 From: Tatsuya Yamaguchi Date: Tue, 9 Mar 2021 10:50:30 +0900 Subject: [PATCH] AP_InertialSensor: fix temperature sensor on LSM9DS0 --- libraries/AP_InertialSensor/AP_InertialSensor_LSM9DS0.cpp | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/libraries/AP_InertialSensor/AP_InertialSensor_LSM9DS0.cpp b/libraries/AP_InertialSensor/AP_InertialSensor_LSM9DS0.cpp index fafc42283d..8372f7c80b 100644 --- a/libraries/AP_InertialSensor/AP_InertialSensor_LSM9DS0.cpp +++ b/libraries/AP_InertialSensor/AP_InertialSensor_LSM9DS0.cpp @@ -387,7 +387,7 @@ AP_InertialSensor_LSM9DS0::AP_InertialSensor_LSM9DS0(AP_InertialSensor &imu, , _rotation_a(rotation_a) , _rotation_g(rotation_g) , _rotation_gH(rotation_gH) - , _temp_filter(80, 1) + , _temp_filter(400, 1) { } @@ -742,7 +742,7 @@ void AP_InertialSensor_LSM9DS0::_read_data_transaction_a() _notify_new_accel_raw_sample(_accel_instance, accel_data, AP_HAL::micros64()); // read temperature every 10th sample - if (_temp_counter == 10) { + if (_temp_counter++ >= 10) { int16_t traw; const uint8_t regtemp = OUT_TEMP_L_XM | 0xC0; _temp_counter = 0;