public class FtdiBoard extends Board {
static {
- System.load(new File("build/"+System.mapLibraryName("Ftdi")).getAbsolutePath());
+ System.load(new File("build/"+System.mapLibraryName("FtdiUartNative")).getAbsolutePath());
}
private final ChipImpl chip;
public FtdiBoard() throws Exception {
chip = new ChipImpl();
- boot(new InputStreamReader(new FileInputStream("bitstreams/usbdrone.bst")));
+ String bstFile = this.getClass().getName();
+ bstFile = bstFile.substring(0, bstFile.lastIndexOf('.'));
+ bstFile = bstFile.replace('.', '/')+"/slipway_drone.bst";
+ boot(new InputStreamReader(this.getClass().getClassLoader().getResourceAsStream(bstFile)));
in = chip.getInputStream();
out = chip.getOutputStream();
for(int i=0; i<255; i++) out.write(0);
out.flush();
}
- public void reset() {
+ public void reset() throws IOException {
chip.doReset();
}
//System.out.println("avr reset => true");
chip.purge();
- chip.uart(1<<1, 1<<1);
+ chip.uart_and_cbus_mode(1<<1, 1<<1);
//d.avrrst(true);
//try { Thread.sleep(500); } catch (Exception e) { }