From: michael Date: Mon, 30 Apr 2007 23:52:35 +0000 (+0000) Subject: correctly set the baudrate, this speeds up things a bit X-Git-Url: https://git.zerfleddert.de/cgi-bin/gitweb.cgi/usb-driver/commitdiff_plain/66c1fd53cb58160b7997f99879f2cf546a97e6b8?ds=sidebyside correctly set the baudrate, this speeds up things a bit --- diff --git a/jtagkey.c b/jtagkey.c index e17afc8..129cfe1 100644 --- a/jtagkey.c +++ b/jtagkey.c @@ -7,6 +7,7 @@ #include "jtagkey.h" #define USBBUFSIZE 1048576 +#define JTAG_SPEED 100000 #define SLOW_AND_SAFE 1 static struct ftdi_context ftdic; @@ -51,11 +52,6 @@ static int jtagkey_init(unsigned short vid, unsigned short pid) { return ret; } - if ((ret = ftdi_set_baudrate(&ftdic, 500000)) != 0) { - fprintf(stderr, "unable to set baudrate: %d (%s)\n", ret, ftdi_get_error_string(&ftdic)); - return ret; - } - c = 0x00; ftdi_write_data(&ftdic, &c, 1); @@ -64,6 +60,11 @@ static int jtagkey_init(unsigned short vid, unsigned short pid) { return ret; } + if ((ret = ftdi_set_baudrate(&ftdic, JTAG_SPEED)) != 0) { + fprintf(stderr, "unable to set baudrate: %d (%s)\n", ret, ftdi_get_error_string(&ftdic)); + return ret; + } + bitbang_mode = BITMODE_SYNCBB; if ((ret = ftdi_usb_purge_buffers(&ftdic)) != 0) {