-
-
Notifications
You must be signed in to change notification settings - Fork 94
Reducing excessive I2C timeout #494
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
...bility to set the timeout to custom value)
libraries/Wire/Wire.h
Outdated
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.
If this has an equivalent purpose to the AVR Wire library's setWireTimeout
function:
then please be consistent with the already well established API:
@per1234 I renamed the function according to the request, however please note that in the current implementation of Wire (at least in Core-Renesas) the Wire class is derived from HardwareI2C class, that is derived from Stream. And Stream has already setTimeout function.
void setTimeout(unsigned long timeout); // sets maximum milliseconds to wait for stream data, default is 1 second
In my opinion it is better to use setTimeout name which is in line with the current class derivation scheme.
This PR takes care of issue #492 .
There was a default timeout of 1000 ms in I2C communication.
Timeout has been reduced to 1ms.
However (although this is not a standard Wire function) a setTimeout() function has been added to Wire class so that users can tune the value.