examples/java: Update, indent and add [Interesting] tags to examples

Signed-off-by: Petre Eftime <petre.p.eftime@intel.com>
Signed-off-by: Brendan Le Foll <brendan.le.foll@intel.com>
This commit is contained in:
Petre Eftime
2015-09-30 13:21:23 +03:00
committed by Brendan Le Foll
parent 013c04c7b9
commit 0e44dfac44
5 changed files with 133 additions and 108 deletions

View File

@@ -23,32 +23,30 @@
*/
public class Isr {
static {
try {
System.loadLibrary("mraajava");
} catch (UnsatisfiedLinkError e) {
System.err.println(
"Native code library failed to load. See the chapter on Dynamic Linking Problems in the SWIG Java documentation for help.\n" +
e);
System.exit(1);
static {
try {
System.loadLibrary("mraajava");
} catch (UnsatisfiedLinkError e) {
System.err.println(
"Native code library failed to load. See the chapter on Dynamic Linking Problems in the SWIG Java documentation for help.\n" +
e);
System.exit(1);
}
}
}
public static void main(String argv[]) {
mraa.mraa.init();
public static void main(String argv[]) throws InterruptedException {
mraa.mraa.init();
mraa.Gpio gpio = new mraa.Gpio(7);
mraa.Gpio gpio = new mraa.Gpio(7);
mraa.IsrCallback callback = new JavaCallback();
mraa.IsrCallback callback = new JavaCallback();
gpio.isr(mraa.Edge.EDGE_RISING, callback, null);
while (true)
;
};
gpio.isr(mraa.Edge.EDGE_RISING, callback);
Thread.sleep(0);
};
}
;
class JavaCallback extends mraa.IsrCallback {
public JavaCallback() { super(); }
public JavaCallback() { super(); }
public void run() { System.out.println("JavaCallback.run()"); }
public void run() { System.out.println("JavaCallback.run()"); }
}