X-Git-Url: http://git.megacz.com/?a=blobdiff_plain;f=src%2Fcom%2Fatmel%2Ffpslic%2FFpslicRawUsb.java;h=61b687bdded73c79b4406cb4a1d92dd0c537ebf1;hb=9752e92536ce2e72fd2a214690743d21d644df5a;hp=ca3737e3a029b1311128919b8d614f02f71edc05;hpb=5aeb7bdf450ed5f7848218e1e33494ce4edd7858;p=slipway.git diff --git a/src/com/atmel/fpslic/FpslicRawUsb.java b/src/com/atmel/fpslic/FpslicRawUsb.java index ca3737e..61b687b 100644 --- a/src/com/atmel/fpslic/FpslicRawUsb.java +++ b/src/com/atmel/fpslic/FpslicRawUsb.java @@ -35,19 +35,12 @@ public class FpslicRawUsb implements FpslicRaw { (1<<5) | (1<<6) | (1<<7); - avrrst(false); - - flush(); - //purge(); - ftdiuart.dbus_mode(dmask); - flush(); + avrrst(false); clk(false); data(false); con(false); - flush(); - //try { Thread.sleep(500); } catch (Exception e) { } reset(false); flush(); @@ -64,16 +57,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< " + pin + " " + (pin ? green("good") : red("BAD"))); - reset(); - try { Thread.sleep(100); } catch (Exception e) { } - config(0,3); + getConfigStream(); + config(0,1); con(); config(0,6); flush(); - // one too many config(Integer.parseInt("10110111", 2), 8); config(0, 2); flush(); @@ -135,9 +129,10 @@ public class FpslicRawUsb implements FpslicRaw { pin = initErr(); System.out.println("bad preamble #2 => " + pin + " " + (pin ? red("BAD") : green("good"))); - 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(); @@ -163,7 +158,7 @@ public class FpslicRawUsb implements FpslicRaw { boolean bit = (dat & (1<