checkpoint
authoradam <adam@megacz.com>
Thu, 21 Sep 2006 14:28:34 +0000 (15:28 +0100)
committeradam <adam@megacz.com>
Thu, 21 Sep 2006 14:28:34 +0000 (15:28 +0100)
src/com/atmel/fpslic/FpslicRawUsb.java
src/edu/berkeley/slipway/FtdiBoard.java

index ca3737e..f8011e5 100644 (file)
@@ -64,16 +64,16 @@ public class FpslicRawUsb implements FpslicRaw {
 
     public OutputStream getConfigStream() throws IOException {
         reset();
-        config(0,3);
-        con();
-        config(0,7);
+        config(0,2);
         flush();
         return new OutputStream() {
                 int bytes = 0;
                 int bits = 0;
                 public void write(int in) throws IOException {
                     for(int i=7; i>=0; i--) {
+                        bits++;
                         config((((in & 0xff) & (1<<i))!=0)?1:0, 1);
+                        if (bits==1) con();
                     }
                 }
                 public void write(byte[] b, int off, int len) throws IOException {
@@ -114,6 +114,9 @@ public class FpslicRawUsb implements FpslicRaw {
         boolean pin;
 
         getConfigStream();
+        config(0,1);
+        con();
+        config(0,7);
         config(Integer.parseInt("10110111", 2), 8);
         config(0,1);
         flush();
@@ -138,6 +141,9 @@ public class FpslicRawUsb implements FpslicRaw {
         reset();
         try { Thread.sleep(100); } catch (Exception e) { }
         getConfigStream();
+        config(0,1);
+        con();
+        config(0,7);
         config(Integer.parseInt("11110111", 2), 8);
         config(0, 1);
         flush();
index 27c9440..d84afa1 100644 (file)
@@ -43,7 +43,6 @@ public class FtdiBoard extends Board {
 
         OutputStream os = chip.getConfigStream();
         BufferedReader br = new BufferedReader(r);
-        br.readLine();
 
         int bytes = 0;
         while(true) {