better balancing of the latency timer to decrease result byte fragmentation

git-svn-id: https://urjtag.svn.sourceforge.net/svnroot/urjtag/trunk@1074 b68d4a1b-bc3d-0410-92ed-d4ac073336b7
master
Arnim Läuger 17 years ago
parent 6ccb9d3502
commit 16acc81484

@ -1,9 +1,12 @@
2008-02-21 Arnim Laeuger <arniml@users.sourceforge.net>
* src/tap/parport/ftdi.c (ftdi_mpsse_open): set latency timer to 16ms
* src/tap/parport/ftd2xx.c (ftd2xx_mpsse_open): set latency timer to 16ms
* src/tap/cable/ft2232.c (send_and_receive): issue SEND_IMMEDIATE command
when receive bytes were scheduled
* src/bsdl/bsdl_bison.y, src/bsdl/bsdl.h, src/bsdl/bsdl_flex.l, src/bsdl/bsdl.c:
push mode and debug through init tree to avoid error message from scanner
in simple test mode.
* src/bus/fjmem.c: merged branches/jmem to trunk
-> added fjmem bus driver

@ -73,6 +73,7 @@
#define LOOPBACK_START 0x84
#define LOOPBACK_END 0x85
#define TCK_DIVISOR 0x86
#define SEND_IMMEDIATE 0x87
/* bit and bitmask definitions for GPIO commands */
@ -257,6 +258,11 @@ send_and_receive( cable_t *cable )
bytes_sent++;
}
/* the SEND_IMMEDIATE command will trigger the ft2232 to send
its bytes immediately without waiting for the latency timeout */
if (bytes_to_recv)
parport_set_data( p, SEND_IMMEDIATE );
/* Step 2: flush parport */
parport_set_control( p, 1 ); // flush
parport_set_control( p, 0 ); // noflush

@ -292,6 +292,14 @@ ftd2xx_mpsse_open( parport_t *parport )
FT_Close(fc);
return -1;
}
/* set a reasonnable latency timer value
if this value is too low then the chip will send intermediate result data
in short packets (suboptimal performance) */
if ((status = FT_SetLatencyTimer(fc, 16)) != FT_OK) {
fprintf(stderr, "Can't set target latency timer: %li\n", status);
FT_Close(fc);
return -1;
}
if ((status = FT_SetBitMode( fc, 0x00, 0x00 )) != FT_OK) {
fprintf(stderr, "Can't disable bitmode: %li\n", status);
FT_Close(fc);
@ -312,11 +320,6 @@ ftd2xx_mpsse_open( parport_t *parport )
FT_Close(fc);
return -1;
}
if ((status = FT_SetLatencyTimer(fc, 1)) != FT_OK) {
fprintf(stderr, "Can't set latency timer: %li\n", status);
FT_Close(fc);
return -1;
}
return 0;
}

@ -322,6 +322,17 @@ ftdi_mpsse_open( parport_t *parport )
ftdi_deinit(fc);
return -1;
}
/* set a reasonnable latency timer value
if this value is too low then the chip will send intermediate result data
in short packets (suboptimal performance) */
if(ftdi_set_latency_timer(fc, 16) < 0)
{
fprintf (stderr, "Can't set target latency: %s\n",
ftdi_get_error_string (fc));
ftdi_usb_close(fc);
ftdi_deinit(fc);
return -1;
}
if (ftdi_set_bitmode(fc, 0x0b, BITMODE_RESET) < 0)
{
@ -330,7 +341,7 @@ ftdi_mpsse_open( parport_t *parport )
ftdi_usb_close(fc);
ftdi_deinit(fc);
return -1;
};
}
if (ftdi_set_bitmode(fc, 0x0b, BITMODE_MPSSE) < 0)
{
fprintf (stderr, "Can't set mpsse mode: %s\n",
@ -338,7 +349,7 @@ ftdi_mpsse_open( parport_t *parport )
ftdi_usb_close(fc);
ftdi_deinit(fc);
return -1;
};
}
if (ftdi_usb_reset(fc) < 0)
{
@ -357,14 +368,6 @@ ftdi_mpsse_open( parport_t *parport )
return -1;
}
if(ftdi_set_latency_timer(fc, 1) < 0)
{
fprintf (stderr, "Can't set minimum latency: %s\n",
ftdi_get_error_string (fc));
ftdi_usb_close(fc);
ftdi_deinit(fc);
return -1;
};
return 0;
}

Loading…
Cancel
Save