mirror of
https://github.com/processing/processing4.git
synced 2026-06-16 04:26:26 +02:00
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:
@@ -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));
|
||||
|
||||
Reference in New Issue
Block a user