I/O: Add helpful text for I2C errors

This commit is contained in:
gohai
2015-10-12 17:10:15 +02:00
parent 622e907d68
commit 341a9073be
@@ -120,6 +120,9 @@ public class I2C {
transmitting = false;
out = null;
if (ret < 0) {
if (ret == -5) { // EIO
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));
}
}
@@ -170,6 +173,9 @@ public class I2C {
transmitting = false;
out = null;
if (ret < 0) {
if (ret == -5) { // EIO
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));
}