Description
During my work with lps25hb pressure sensor I have faced problem that fractional part of the measurement is completely wrong. During debug I figured out that we are probably overflowing int32_t
range during computations in this function:
Since this sensor is returning 24 bit wide result - when we multiply it million times - it will clearly overflow.
So my local solution for now is:
To give compiler the idea that we need 64 bit value in order to proceed with calculations. As far as I have tested it - it works like a charm.
What do you guys think? Is it a good solution? Should I create a pull request for that?