IO: Make I2C errors more verbose

The error code returned from C seems to have changed from -EIO to -EREMOTEIO during some recent kernel version.
This commit is contained in:
gohai
2018-07-10 10:16:46 -07:00
parent f14200e6fe
commit 80453e84ba
+2 -2
View File
@@ -125,7 +125,7 @@ public class I2C {
transmitting = false;
out = null;
if (ret < 0) {
if (ret == -5) { // EIO
if (ret == -5 | ret == -121) { // EIO | EREMOTEIO
System.err.println("The device did not respond. Check the cabling and whether you are using the correct address.");
}
throw new RuntimeException(NativeInterface.getError(ret));
@@ -185,7 +185,7 @@ public class I2C {
transmitting = false;
out = null;
if (ret < 0) {
if (ret == -5) { // EIO
if (ret == -5 | ret == -121) { // EIO | EREMOTEIO
System.err.println("The device did not respond. Check the cabling and whether you are using the correct address.");
}
throw new RuntimeException(NativeInterface.getError(ret));