X-Git-Url: http://git.megacz.com/?a=blobdiff_plain;f=src%2Fedu%2Fberkeley%2Fslipway%2FFtdiBoard.java;h=17f9cce7ac911574e76a192b7ea8afd0bfe4a674;hb=c500701544bf3f44cf90713c8c7d95cf84bd001e;hp=27c9440f9a1248003916b96763c4c952f19d225b;hpb=5aeb7bdf450ed5f7848218e1e33494ce4edd7858;p=slipway.git diff --git a/src/edu/berkeley/slipway/FtdiBoard.java b/src/edu/berkeley/slipway/FtdiBoard.java index 27c9440..17f9cce 100644 --- a/src/edu/berkeley/slipway/FtdiBoard.java +++ b/src/edu/berkeley/slipway/FtdiBoard.java @@ -3,7 +3,7 @@ package edu.berkeley.slipway; import com.ftdi.usb.*; import com.atmel.fpslic.*; import edu.berkeley.obits.*; -import org.ibex.util.Log; +import org.ibex.util.*; import java.io.*; import java.util.*; import gnu.io.*; @@ -14,7 +14,7 @@ public class FtdiBoard extends Board { System.load(new File("build/"+System.mapLibraryName("FtdiUartNative")).getAbsolutePath()); } - private final FpslicRaw chip; + private final FpslicBoot chip; private final InputStream in; private final OutputStream out; @@ -22,7 +22,7 @@ public class FtdiBoard extends Board { public OutputStream getOutputStream() { return out; } public FtdiBoard() throws Exception { - chip = new FpslicRawUsb(new FtdiUart(0x6666, 0x3133, 1500 * 1000)); + chip = new FpslicBoot(new FpslicBootPinsUsb(new FtdiUart(0x6666, 0x3133, 1500 * 1000))); String bstFile = this.getClass().getName(); bstFile = bstFile.substring(0, bstFile.lastIndexOf('.')); bstFile = bstFile.replace('.', '/')+"/slipway_drone.bst"; @@ -41,9 +41,9 @@ public class FtdiBoard extends Board { chip.selfTest(); - OutputStream os = chip.getConfigStream(); + int total = 75090/9; + OutputStream os = new ProgressOutputStream("bootstrap bitstream:", chip.getConfigStream(), total); BufferedReader br = new BufferedReader(r); - br.readLine(); int bytes = 0; while(true) { @@ -51,10 +51,7 @@ public class FtdiBoard extends Board { if (s==null) break; bytes++; os.write((byte)Integer.parseInt(s, 2)); - if ((bytes % 1000)==0) { - os.flush(); - System.out.print("wrote " + bytes + " bytes\r"); - } + if ((bytes % 1000)==0) os.flush(); } os.close(); }