mirror of
https://github.com/processing/processing4.git
synced 2026-06-16 04:26:26 +02:00
I/O: Add helpful text for I2C errors
This commit is contained in:
@@ -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));
|
||||
}
|
||||
|
||||
|
||||
Reference in New Issue
Block a user