reference-en icon indicating copy to clipboard operation
reference-en copied to clipboard

[Documentation] Wire read return type

Open CombiesGit opened this issue 5 years ago • 1 comments

Docu: Wire::read()

Returns The next byte received

It should be:

Returns The next byte received (or -1 if no data is available). Data type: int.

CombiesGit avatar Jul 16 '20 21:07 CombiesGit

Is that always meant to be the case? In the Mbed core it looks like it returns 0: https://github.com/arduino/ArduinoCore-mbed/blob/949c70ce6ae7d2910e5768d6d88fc3ae0e943584/libraries/Wire/Wire.cpp#L123

Edit: It is meant to be -1, the Mbed core will be updated.

carlosperate avatar Dec 25 '22 20:12 carlosperate