-
Notifications
You must be signed in to change notification settings - Fork 105
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
Added check connection state for i2c devices #120
base: master
Are you sure you want to change the base?
Changes from 1 commit
File filter
Filter by extension
Conversations
Jump to
Diff view
Diff view
There are no files selected for viewing
Original file line number | Diff line number | Diff line change |
---|---|---|
|
@@ -132,3 +132,11 @@ bool BME280Spi::WriteRegister | |
|
||
return true; | ||
} | ||
|
||
|
||
/****************************************************************/ | ||
bool BME280Spi::IsConnected(void) { | ||
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. Since these are defaulted to true, this indicates to me that IsConnected shouldn't be in the base class. There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. That's correct. Now it's implemented much simpler! Thank you for your annotation. |
||
// not possible here. Connection state can be discovered by reading the | ||
// chip ID which is done during initalization | ||
return true; | ||
} |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
This is on the user, per previous issue
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
My investigations showed that
Wire.begin()
is necessary to have a non blocking behaviour forWire.endTransmission()
.I just tested it here again.