mirror of
https://gitee.com/mirrors_PX4/PX4-Autopilot.git
synced 2026-05-02 02:54:08 +08:00
bosch/bmi055: fix accel temperature reading
- single register output is in 2's complement
This commit is contained in:
parent
1672fc646f
commit
427b17d8a1
@ -455,7 +455,8 @@ void BMI055_Accelerometer::FIFOReset()
|
||||
void BMI055_Accelerometer::UpdateTemperature()
|
||||
{
|
||||
// The slope of the temperature sensor is 0.5K/LSB, its center temperature is 23°C [(ACC 0x08) temp = 0x00].
|
||||
float temperature = RegisterRead(Register::ACCD_TEMP) * 0.5f + 23.f;
|
||||
// The register contains the current chip temperature represented in two’s complement format.
|
||||
float temperature = static_cast<int8_t>(RegisterRead(Register::ACCD_TEMP)) * 0.5f + 23.f;
|
||||
|
||||
if (PX4_ISFINITE(temperature)) {
|
||||
_px4_accel.set_temperature(temperature);
|
||||
|
||||
Loading…
x
Reference in New Issue
Block a user