checkpoint
authoradam <adam@megacz.com>
Fri, 22 Sep 2006 03:44:47 +0000 (04:44 +0100)
committeradam <adam@megacz.com>
Fri, 22 Sep 2006 03:44:47 +0000 (04:44 +0100)
src/com/atmel/fpslic/FpslicBootPinsUsb.java
src/edu/berkeley/obits/device/atmel/AvrDrone.java

index 32d5763..d6e14ac 100644 (file)
@@ -65,6 +65,7 @@ public class FpslicBootPinsUsb implements FpslicBootPins {
         avrrstPin(false);
         ftdiuart.purge();
         ftdiuart.uart_and_cbus_mode(1<<1, 1<<1);
+        ftdiuart.purge();
     }
     
     private int dmask =
index 47aa49d..ce3a083 100644 (file)
@@ -41,7 +41,11 @@ public class AvrDrone extends AtmelDevice {
         */
         byte[] bytes = new byte[6];
         int i=0;
+
         out.write(0);
+        out.flush();
+
+        // read any crap that might be left in the buffer
         while(true) {
             System.arraycopy(bytes, 1, bytes, 0, 5);
             bytes[5] = in.readByte();