1
0

ignore no-ops

This commit is contained in:
michael 2007-04-29 14:40:03 +00:00
parent d0e2002d3a
commit e81047b815

View File

@ -98,14 +98,14 @@ int jtagkey_transfer(WD_TRANSFER *tr, int fd, unsigned int request, int ppbase,
unsigned long port; unsigned long port;
unsigned char val; unsigned char val;
static unsigned char last_data = 0; static unsigned char last_data = 0;
static unsigned char last_write = 0x00;
static unsigned char writebuf[USBBUFSIZE], *writepos = writebuf; static unsigned char writebuf[USBBUFSIZE], *writepos = writebuf;
static unsigned char readbuf[USBBUFSIZE], *readpos; static unsigned char readbuf[USBBUFSIZE], *readpos;
unsigned char data; unsigned char data, prev_data;
static unsigned char last_write = 0x00;
/* Count writes */ /* Count reads */
for (i = 0; i < num; i++) for (i = 0; i < num; i++)
if (tr[i].cmdTrans == 10) if (tr[i].cmdTrans == PP_READ)
nread++; nread++;
/* Write combining */ /* Write combining */
@ -117,7 +117,7 @@ int jtagkey_transfer(WD_TRANSFER *tr, int fd, unsigned int request, int ppbase,
i = 0; i = 0;
while (i < writepos-writebuf) { while (i < writepos-writebuf) {
i += ftdi_read_data(&ftdic, readbuf, sizeof(readbuf)); i += ftdi_read_data(&ftdic, readbuf, sizeof(readbuf));
}; }
DPRINTF("read %d/%d bytes\n", i, writepos-writebuf); DPRINTF("read %d/%d bytes\n", i, writepos-writebuf);
writepos = writebuf; writepos = writebuf;
} }
@ -137,6 +137,7 @@ int jtagkey_transfer(WD_TRANSFER *tr, int fd, unsigned int request, int ppbase,
/* Pad writebuf for read-commands in stream */ /* Pad writebuf for read-commands in stream */
*writepos = last_data; *writepos = last_data;
prev_data = last_data;
if (port == ppbase + PP_DATA) { if (port == ppbase + PP_DATA) {
DPRINTF("data port\n"); DPRINTF("data port\n");
@ -191,7 +192,9 @@ int jtagkey_transfer(WD_TRANSFER *tr, int fd, unsigned int request, int ppbase,
break; break;
} }
} }
writepos++;
if (nread || (*writepos != prev_data))
writepos++;
} }
if (nread) if (nread)