Skip to content

Commit 49600d1

Browse files
committed
IOIO: partially complete CapSense
1 parent 2d97844 commit 49600d1

File tree

1 file changed

+5
-3
lines changed

1 file changed

+5
-3
lines changed

ioio/src/main/java/net/sourceforge/smallbasic/ioio/CapSenseImpl.java

Lines changed: 5 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -7,6 +7,7 @@
77

88
public class CapSenseImpl extends IOTask implements CapSense {
99
private static final String TAG = "CapSense";
10+
private static final IOLock<CapSense> lock = new IOLock<>();
1011
private CapSense capSense;
1112

1213
public CapSenseImpl() {
@@ -23,21 +24,22 @@ public void close() {
2324

2425
@Override
2526
public void loop() throws ConnectionLostException, InterruptedException {
27+
lock.process(capSense);
2628
}
2729

2830
@Override
2931
public float read() throws InterruptedException, ConnectionLostException {
30-
return 0;
32+
return lock.invoke(CapSense::read);
3133
}
3234

3335
@Override
3436
public float readSync() throws InterruptedException, ConnectionLostException {
35-
return 0;
37+
return lock.invoke(CapSense::readSync);
3638
}
3739

3840
@Override
3941
public void setFilterCoef(float t) throws ConnectionLostException {
40-
42+
throw new UnsupportedOperationException();
4143
}
4244

4345
@Override

0 commit comments

Comments
 (0)