adafruit/Adafruit_VL6180X

No need to wait after Wire.requestFrom()

Closed this issue · 1 comments

In the function Adafruit_VL6180X::read16() a while-loop is used to wait for Wire.available() before reading a byte. That is not needed, since the received data is already in the receive buffer inside the Wire library.

In case of a single bus error (a collision in a multi-master bus or other error), the Wire.requestFrom() could return zero and also the Wire.available() would be zero. That single bus error would halt the sketch because the while-loop will never get out of its loop.

done!