init();
}
- public void reset() throws DeviceException {
- try {
- board.reset();
- } catch (IOException e) {
- throw new DeviceException(e);
- }
+ public void reset() throws IOException {
+ board.reset();
}
private void init() throws IOException {
}
- public synchronized void scanFPGA(boolean on) throws DeviceException {
- try {
- if (on) {
- out.writeByte(3);
- out.flush();
- } else {
- // FIXME
- }
- } catch (IOException e) { throw new DeviceException(e); }
+ public synchronized void scanFPGA(boolean on) throws IOException {
+ if (on) {
+ out.writeByte(3);
+ out.flush();
+ } else {
+ // FIXME
+ }
}
// fixme!
public static int retval = 0;
- public synchronized int readCount() throws DeviceException {
+ public synchronized int readCount() {
try {
if (reader != null) {
reader.start();
bc.wait();
}
return retval;
- } catch (Exception e) { throw new DeviceException(e); }
+ } catch (Exception e) { throw new RuntimeException(e); }
}
public static interface ByteCallback {
}
};
- public synchronized void readBus(ByteCallback bc) throws DeviceException {
- try {
- callbacks.add(bc);
- out.writeByte(2);
- out.flush();
- if (reader != null) {
- reader.start();
- reader = null;
- }
- } catch (IOException e) { throw new DeviceException(e); }
+ public synchronized void readBus(ByteCallback bc) throws IOException {
+ callbacks.add(bc);
+ out.writeByte(2);
+ out.flush();
+ if (reader != null) {
+ reader.start();
+ reader = null;
+ }
}
- public synchronized void readInterrupts(ByteCallback bc) throws DeviceException {
- try {
- callbacks.add(bc);
- out.writeByte(6);
- out.flush();
- if (reader != null) {
- reader.start();
- reader = null;
- }
- } catch (IOException e) { throw new DeviceException(e); }
+ public synchronized void readInterrupts(ByteCallback bc) throws IOException {
+ callbacks.add(bc);
+ out.writeByte(6);
+ out.flush();
+ if (reader != null) {
+ reader.start();
+ reader = null;
+ }
}
private byte[][][] cache = new byte[24][][];
- public /*synchronized*/ byte mode4(int z, int y, int x) throws DeviceException {
+ public /*synchronized*/ byte mode4(int z, int y, int x) {
if (cache[x]==null) return 0;
if (cache[x][y]==null) return 0;
return cache[x][y][z];
int lasty = 0;
public static int save = 0;
public static int saveof = 0;
- public /*synchronized*/ void mode4(int z, int y, int x, int d) throws DeviceException {
+ public /*synchronized*/ void mode4(int z, int y, int x, int d) {
try {
/*
Log.info(this, "writing configuration frame [zyxd]: " +
if (cache[x & 0xff]==null) cache[x & 0xff] = new byte[24][];
if (cache[x & 0xff][y & 0xff]==null) cache[x & 0xff][y & 0xff] = new byte[256];
cache[x & 0xff][y & 0xff][z & 0xff] = (byte)(d & 0xff);
- } catch (IOException e) { throw new DeviceException(e); }
+ } catch (IOException e) {
+ throw new RuntimeException(e);
+ }
}
- public /*synchronized*/ void flush() throws DeviceException {
+ public /*synchronized*/ void flush() {
try {
out.flush();
- } catch (IOException e) { throw new DeviceException(e); }
+ } catch (IOException e) {
+ throw new RuntimeException(e);
+ }
}
private String pad(int i, String s) { if (s.length()>i) return s; return "0"+pad((i-1),s); }