Skip to content

Commit

Permalink
[driver] Fix MS5611 calibrated value calculation
Browse files Browse the repository at this point in the history
  • Loading branch information
rasmuskleist committed Jun 4, 2023
1 parent eda224e commit 1f0251c
Showing 1 changed file with 1 addition and 1 deletion.
2 changes: 1 addition & 1 deletion src/modm/driver/pressure/ms5611_data_impl.hpp
Original file line number Diff line number Diff line change
Expand Up @@ -51,7 +51,7 @@ Data::calculateCalibratedValues()
// Compute intermediate values used to calculate the pressure and temperature
int32_t dT = rawTemp - (uint32_t(prom.data[5]) << 8);
int64_t off = (int64_t(prom.data[2]) << 16) + ((int64_t(prom.data[4]) * int64_t(dT)) >> 7);
int64_t sens = (int64_t(prom.data[1]) << 15) + ((int64_t(prom.data[5]) * int64_t(dT)) >> 8);
int64_t sens = (int64_t(prom.data[1]) << 15) + ((int64_t(prom.data[3]) * int64_t(dT)) >> 8);

// Compute temperature without second order compensation
int32_t temp = 2000 + ((int64_t(dT) * prom.data[6]) >> 23);
Expand Down

0 comments on commit 1f0251c

Please sign in to comment.