Bläddra i källkod

java: updated samples that use interrupts with Runnable implementation

Signed-off-by: Mihai Tudor Panu <mihai.tudor.panu@intel.com>
Mihai Tudor Panu 9 år sedan
förälder
incheckning
46996e5251
2 ändrade filer med 4 tillägg och 8 borttagningar
  1. 2
    4
      examples/java/A110X_intrSample.java
  2. 2
    4
      examples/java/RPR220_intrSample.java

+ 2
- 4
examples/java/A110X_intrSample.java Visa fil

@@ -22,8 +22,6 @@
22 22
  * WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE.
23 23
  */
24 24
 
25
-import upm_a110x.IsrCallback;
26
-
27 25
 public class A110X_intrSample {
28 26
 	
29 27
 	public static int counter=0;
@@ -38,7 +36,7 @@ public class A110X_intrSample {
38 36
 		// is detected.  This could be used to measure the rotations per
39 37
 		// minute (RPM) of a rotor for example.
40 38
 
41
-		IsrCallback callback = new A110XISR();
39
+		A110XISR callback = new A110XISR();
42 40
 		hall.installISR(callback);
43 41
 		
44 42
 		while(true){
@@ -49,7 +47,7 @@ public class A110X_intrSample {
49 47
 	}
50 48
 }
51 49
 
52
-class A110XISR extends IsrCallback {
50
+class A110XISR implements Runnable {
53 51
 	public A110XISR(){
54 52
 		super();
55 53
 	}

+ 2
- 4
examples/java/RPR220_intrSample.java Visa fil

@@ -22,8 +22,6 @@
22 22
  * WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE.
23 23
  */
24 24
 
25
-import upm_rpr220.IsrCallback;
26
-
27 25
 public class RPR220_intrSample {
28 26
 
29 27
 	public static int counter = 0;
@@ -35,7 +33,7 @@ public class RPR220_intrSample {
35 33
 		// Instantiate an RPR220 digital pin D2
36 34
 		upm_rpr220.RPR220 sensor = new upm_rpr220.RPR220(2);
37 35
 
38
-		IsrCallback callback = new RPRISR();
36
+		RPRISR callback = new RPRISR();
39 37
 		sensor.installISR(callback);
40 38
 
41 39
 		while (true) {
@@ -46,7 +44,7 @@ public class RPR220_intrSample {
46 44
 	}
47 45
 }
48 46
 
49
-class RPRISR extends IsrCallback {
47
+class RPRISR implements Runnable {
50 48
 	public RPRISR() {
51 49
 		super();
52 50
 	}