From: michael Date: Sun, 29 Apr 2007 18:48:10 +0000 (+0000) Subject: some more performance improvements X-Git-Url: https://git.zerfleddert.de/cgi-bin/gitweb.cgi/usb-driver/commitdiff_plain/3f5287b7f725b0e90b8a29b4ed3e16cfdc8d6fbe?hp=a270f1e37a49ae072740de471bfe98658dea3b5e some more performance improvements --- diff --git a/jtagkey.c b/jtagkey.c index bf1cded..04cfb4c 100644 --- a/jtagkey.c +++ b/jtagkey.c @@ -208,10 +208,35 @@ int jtagkey_transfer(WD_TRANSFER *tr, int fd, unsigned int request, int ppbase, { DPRINTF("writing %d bytes\n", writepos-writebuf); for (i=0; i 0 && + tr[combine-1].cmdTrans == PP_READ) { + break; + } else { + combine++; + } + } while (combine < writepos-writebuf); + + DPRINTF("combined writes before read: %d\n", combine); + + if ((combine-i)-1 > 0) { + ftdi_write_data(&ftdic, writebuf+i, (combine-i)-1); + i = combine-1; + } +#endif + ftdi_write_data(&ftdic, writebuf+i, 1); if (i > 0 && tr[i].cmdTrans == PP_WRITE && tr[i-1].cmdTrans == PP_READ) ftdi_read_pins(&ftdic, readbuf+i); + + if (i == (writepos-writebuf)-1 && tr[i].cmdTrans == PP_READ) { + ftdi_write_data(&ftdic, writebuf+i, 1); + ftdi_read_pins(&ftdic, readbuf+i+1); + } } #ifdef DEBUG