Check the return value from i2c_smbus_write_byte_data()#1
Open
masneyb wants to merge 1 commit intolexruee:masterfrom
masneyb:master
Open
Check the return value from i2c_smbus_write_byte_data()#1masneyb wants to merge 1 commit intolexruee:masterfrom masneyb:master
masneyb wants to merge 1 commit intolexruee:masterfrom
masneyb:master
Conversation
was not being checked. This can cause incorrect values to be returned by the driver. With this change, when calling bmp180_temperature(), bmp180_pressure() and bmp180_altitude(), the return value will either be LONG_MIN or -FLT_MAX, depending on the return data type if the operation failed. The caller can call bmp180_get_last_errno() to get the errno of the failed operation. I am encountering this situation with my BMP180 sensor. It is currently outdoors and I believe that moisture may be causing an issue with the sensor. `i2cdetect 1` does not show the sensor, however the test program will return values like: t = 12.800000, p = 99977, a= 112.836433
Author
|
Is there anything that I need to do to have this pull request merged in? Thanks, |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
The call to i2c_smbus_write_byte_data() can fail and the return value
was not being checked. This can cause incorrect values to be returned
by the driver. With this change, when calling bmp180_temperature(),
bmp180_pressure() and bmp180_altitude(), the return value will either
be LONG_MIN or -FLT_MAX, depending on the return data type if the
operation failed. The caller can call bmp180_get_last_errno() to get
the errno of the failed operation.
I am encountering this situation with my BMP180 sensor. It is
currently outdoors and I believe that moisture may be causing an
issue with the sensor.
i2cdetect 1does not show the sensor, howeverthe test program will return values like:
t = 12.800000, p = 99977, a= 112.836433