Skip to content

Commit d0b865c

Browse files
authored
Merge pull request #605 from carlosperate/i2c-read
Wire: Fix return value for read() when there is no data available.
2 parents bbf70c7 + c0cf01c commit d0b865c

File tree

1 file changed

+1
-1
lines changed

1 file changed

+1
-1
lines changed

Diff for: libraries/Wire/Wire.cpp

+1-1
Original file line numberDiff line numberDiff line change
@@ -120,7 +120,7 @@ int arduino::MbedI2C::read() {
120120
if (rxBuffer.available()) {
121121
return rxBuffer.read_char();
122122
}
123-
return 0;
123+
return -1;
124124
}
125125

126126
int arduino::MbedI2C::available() {

0 commit comments

Comments
 (0)