Private
Public Access
2
0

examples: Isr.java now catches exception if invalid pin is specified

Signed-off-by: Henry Bruce <henry.bruce@intel.com>
This commit is contained in:
Henry Bruce
2016-03-01 13:39:08 -08:00
committed by Brendan Le Foll
parent 65dc2e7ea3
commit a51f3a939f

View File

@@ -50,8 +50,14 @@ public class Isr {
}
}
BufferedReader console = new BufferedReader(new InputStreamReader(System.in));
Gpio gpio = null;
try {
gpio = new Gpio(pin);
} catch (Exception e) {
System.out.println(e.getMessage());
return;
}
System.out.println("Starting ISR for pin " + Integer.toString(pin) + ". Press ENTER to stop");
Gpio gpio = new Gpio(pin);
Runnable callback = new JavaCallback(gpio);
gpio.isr(Edge.EDGE_RISING, callback);
try {