X-Git-Url: http://git.megacz.com/?a=blobdiff_plain;f=src%2Fedu%2Fberkeley%2Fslipway%2FFtdiBoard.java;h=d1c582c6b200f3374323f702453ae7fd3fae800d;hb=6e3baea580262d8ec8074350dfcc3308286ae669;hp=d84afa139116fb55dd51e92fd1b5555b4b818117;hpb=9c336acf3a9eefed8bcb09f7f094fd709d9a2073;p=slipway.git diff --git a/src/edu/berkeley/slipway/FtdiBoard.java b/src/edu/berkeley/slipway/FtdiBoard.java index d84afa1..d1c582c 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.*; @@ -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 FpslicRaw(new FpslicPinsUsb(new FtdiUart(0x6666, 0x3133, 1500 * 1000))); String bstFile = this.getClass().getName(); bstFile = bstFile.substring(0, bstFile.lastIndexOf('.')); bstFile = bstFile.replace('.', '/')+"/slipway_drone.bst"; @@ -41,7 +41,8 @@ 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); int bytes = 0; @@ -50,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(); }