We read every piece of feedback, and take your input very seriously.
To see all available qualifiers, see our documentation.
1 parent 73d1376 commit 243b4a7Copy full SHA for 243b4a7
java/libraries/io/src/processing/io/GPIO.java
@@ -492,8 +492,10 @@ public static void releasePin(int pin) {
492
if (ret == -2) { // ENOENT
493
System.err.println("Make sure your kernel is compiled with GPIO_SYSFS enabled");
494
}
495
- // EINVAL is also returned when trying to unexport pins that weren't exported to begin with
496
- throw new RuntimeException(NativeInterface.getError(ret));
+ // EINVAL is returned when trying to unexport pins that weren't exported to begin with, ignore this case
+ if (ret != -22) {
497
+ throw new RuntimeException(NativeInterface.getError(ret));
498
+ }
499
500
501
0 commit comments