-
Notifications
You must be signed in to change notification settings - Fork 41
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
Add main I2C sensor Retry-loop #593
Conversation
Change main I2C polling loop to retry failed sensors 3 times before marking that polling period expired
@brentru ready for review |
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.
I think this is good! It increases how robust the update()
loop is.
I have two notes:
Performance: I know you noted it in the PR description, but I want to get to it in this PR. Let's mark failed reads and only retry the sensors that fail.
Code complexity: I think the update()
loop is growing in its complexity and provided an idea below about encapsulation
This is a result of having retries in the drivers/wrappers, and a desire for them to be faster (more interrupt like). We are therefore removing unnecessary delays while waiting to retry one sensor multiple times, and instead retrying the entire suite of sensors up to three times before failing that periodic reading event.
I was trying to add another driver with a long retry time, and this work was the result instead. See #564
This is unfinished, as currently it will evaluate all sensors again, instead only failing ones need be retried.There will be a follow up PR to remove any unnecessary retries during I2C sensor data reads once this is merged.