perform device reset and RX purge

git-svn-id: https://urjtag.svn.sourceforge.net/svnroot/urjtag/trunk@1301 b68d4a1b-bc3d-0410-92ed-d4ac073336b7
master
Arnim Läuger 17 years ago
parent 3ed23505b2
commit 0214115402

@ -1,3 +1,8 @@
2008-07-10 Arnim Laeuger <arniml@users.sourceforge.net>
* src/tap/usbconn/libftd2xx.c (usbconn_ftd2xx_open): perform device reset
and RX purge
2008-07-09 Arnim Laeuger <arniml@users.sourceforge.net>
* src/tap/usbconn/libftd2xx.c: added some debugging messages

@ -330,7 +330,7 @@ usbconn_ftd2xx_common_open( usbconn_t *conn )
if ((status = FT_Open( 0, &(p->fc) )) != FT_OK)
{
perror( "Unable to open FTDO device.\n" );
perror( "Unable to open FTDI device.\n" );
/* mark ftd2xx layer as not initialized */
p->fc = NULL;
return -1;
@ -353,7 +353,12 @@ usbconn_ftd2xx_open( usbconn_t *conn )
fc = p->fc;
if ((status = FT_SetBitMode( fc, 0x00, 0x00 )) != FT_OK)
if ((status = FT_ResetDevice( fc )) != FT_OK)
perror( _("Can't reset device.\n") );
if (status == FT_OK) if ((status = FT_Purge( fc, FT_PURGE_RX )) != FT_OK)
perror( _("Can't purge RX buffer.\n") );
if (status == FT_OK) if ((status = FT_SetBitMode( fc, 0x00, 0x00 )) != FT_OK)
perror( _("Can't disable bitmode.\n") );
if (status == FT_OK) if ((status = FT_SetLatencyTimer(fc, 2)) != FT_OK)

Loading…
Cancel
Save