-
Notifications
You must be signed in to change notification settings - Fork 14
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
Wait longer after wakeup #30
Conversation
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.
The i2c.write()
retries once, and also in many ports has a one second timeout. But this seems like a good idea in any case.
You can catch the exception and re-try also, though the increased timeout may fix that. The exception I think is equivalent to the Arduino error code. |
I have updated it with the latest commit to catch the exception and retry up to 3 times to match the logic in the arduino driver. |
@dhalbert thank you! I've updated those to pass in the latest commit. |
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.
👍
Updating https://github.com/adafruit/Adafruit_CircuitPython_AD569x to 2.0.4 from 2.0.3: > Merge pull request adafruit/Adafruit_CircuitPython_AD569x#4 from FoamyGuy/fix_circup_instruction Updating https://github.com/adafruit/Adafruit_CircuitPython_AHTx0 to 1.0.23 from 1.0.22: > Merge pull request adafruit/Adafruit_CircuitPython_AHTx0#22 from FoamyGuy/busy_timeout_calibration Updating https://github.com/adafruit/Adafruit_CircuitPython_AM2320 to 1.2.22 from 1.2.21: > Merge pull request adafruit/Adafruit_CircuitPython_AM2320#30 from FoamyGuy/wait_longer_after_wakeup Updating https://github.com/adafruit/Adafruit_CircuitPython_BH1750 to 1.1.12 from 1.1.11: > Merge pull request adafruit/Adafruit_CircuitPython_BH1750#11 from FoamyGuy/improve_docs Updating https://github.com/adafruit/Adafruit_CircuitPython_Bundle/circuitpython_library_list.md to NA from NA: > Updated download stats for the libraries
Intended to resolve #27
Updates the wait time after sending the wakeup command to 100ms which matches the current version of the arduino driver: https://github.com/adafruit/Adafruit_AM2320/blob/master/Adafruit_AM2320.cpp#L138
If I understand correctly it's not really possible to do the for loop retry logic which was added to the arduino driver here because our
i2c.write()
does not return a success flag to check for knowing when to loop. If I am mistaken and there is a way to do that and someone can point me in that direction I can update this with similar logic.