]> git.zerfleddert.de Git - usb-driver/commitdiff
only read pins when needed, now it's a bit faster than a parallel cable
authormichael <michael>
Sun, 29 Apr 2007 17:51:28 +0000 (17:51 +0000)
committermichael <michael>
Sun, 29 Apr 2007 17:51:28 +0000 (17:51 +0000)
jtagkey.c

index c12e235b8984ec5db44776d78d674b6515e2fe2f..bf1cded0ee4978272c5019f5064c8ed70424ec7e 100644 (file)
--- a/jtagkey.c
+++ b/jtagkey.c
@@ -209,7 +209,9 @@ int jtagkey_transfer(WD_TRANSFER *tr, int fd, unsigned int request, int ppbase,
                DPRINTF("writing %d bytes\n", writepos-writebuf);
                for (i=0; i<writepos-writebuf; i++) {
                        ftdi_write_data(&ftdic, writebuf+i, 1);
-                       ftdi_read_pins(&ftdic, readbuf+i);
+
+                       if (i > 0 && tr[i].cmdTrans == PP_WRITE && tr[i-1].cmdTrans == PP_READ)
+                               ftdi_read_pins(&ftdic, readbuf+i);
                }
 
 #ifdef DEBUG
Impressum, Datenschutz