]> git.zerfleddert.de Git - usb-driver/commitdiff
correctly set the baudrate, this speeds up things a bit
authormichael <michael>
Mon, 30 Apr 2007 23:52:35 +0000 (23:52 +0000)
committermichael <michael>
Mon, 30 Apr 2007 23:52:35 +0000 (23:52 +0000)
jtagkey.c

index e17afc8895a71aa55da0bd7bb6bcd5c091a848f0..129cfe1cc652d9d9f4214f74bfb1483d0036a4bd 100644 (file)
--- 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) {
Impressum, Datenschutz