-
Notifications
You must be signed in to change notification settings - Fork 3.1k
Correct integer types in BMP085 driver #3070
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Conversation
the data type for t (U_T) should be long according to the BMP085 datasheet (rev. 1.2, section 3.5). values over 32767 can indeed occur, and in my case lead to a wrong value for the temperature (and consequently also pressure). note: this problem only occurs above a certain temperature (exact value depends on the calibration, but I assume somewhere around 26°C).
this adapts the data types and calculation to be consistent with the datasheet (rev. 1.2, section 3.5). while I did not notice any issues, using the wrong data types could trigger edge cases.
|
These seem sensible enough to me, but I do not have one of these devices to test. Any of the active maintainers have one? @andrmuel Can you elaborate on why |
|
I was able to build the firmware on dev and flash it, but afterwards I was not able to flash any Lua code for testing. In regards to testing with the BMP085: if you want to reproduce the original problem as well, that might be possible with heating it up to 30-40 deg C. |
|
I'm not sure I understand correctly. The commit you are referring to is 14c1b8f (from Sep. 2019)? The commit before that would be c7ff86f, and that is already part of master. It does work on the current master. What would be the benefit of testing it with an older version of master (which contains less of dev)? |
|
The changes in this PR are very local, so that I would not expect any of the changes in dev to influence the outcome of the test. |
|
Given the highly localized nature of this change, as @HHHartmann says, I've just merged it to |
* BMP085 pressure sensor: fix temperature value data type the data type for t (U_T) should be long according to the BMP085 datasheet (rev. 1.2, section 3.5). values over 32767 can indeed occur, and in my case lead to a wrong value for the temperature (and consequently also pressure). note: this problem only occurs above a certain temperature (exact value depends on the calibration, but I assume somewhere around 26°C). * BMP085 pressure sensor: adapt data types and calculation this adapts the data types and calculation to be consistent with the datasheet (rev. 1.2, section 3.5). while I did not notice any issues, using the wrong data types could trigger edge cases.
Fixes #<GitHub-issue-number>.
Make sure all boxes are checked (add x inside the brackets) when you submit your contribution, remove this sentence before doing so.
devbranch rather than formaster.⇒ I only tested it on master; current dev fails for me
docs/*.<Description of and rationale behind this PR>