You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
The usage of the Wire library in this and other repositories can be improved.
Explanation: Common-mistakes, number 1 and 2.
For example this (after a Wire.requestFrom):
unsigned int millis_start = millis();
while (Wire.available() < 6) {
if (io_timeout > 0 && ((unsigned int)millis() - millis_start) > io_timeout)
{
did_timeout = true;
return;
}
}
That could be removed. If you want to check the number of received bytes, it can be replaced by this:
if( Wire.available() != 6) {
did_timeout = true; // it is not a timeout, it is a I2C bus error
return;
}
I am not sure if checking the number of received bytes is very useful, since you don't check the error code from the Wire.endTransmission() when writing data.
A while-loop after the Wire.requestFrom() can be removed:
while (Wire.available() < 3);
A Wire.endTransmission() should not be used after a Wire.requestFrom(). That extra Wire.endTransmission() will cause an extra I2C bus transaction. Removed that will improve the working of the Arduino.
Could you check the repository yourself ? Or do I have to mention all the files ?
The usage of the Wire library in this and other repositories can be improved.
Explanation: Common-mistakes, number 1 and 2.
For example this (after a Wire.requestFrom):
That could be removed. If you want to check the number of received bytes, it can be replaced by this:
I am not sure if checking the number of received bytes is very useful, since you don't check the error code from the
Wire.endTransmission()
when writing data.A while-loop after the Wire.requestFrom() can be removed:
A
Wire.endTransmission()
should not be used after a Wire.requestFrom(). That extraWire.endTransmission()
will cause an extra I2C bus transaction. Removed that will improve the working of the Arduino.Could you check the repository yourself ? Or do I have to mention all the files ?
and the "BlinkM_funcs.h" has also a useless
while(Wire.available
loop.The text was updated successfully, but these errors were encountered: