correctly set the baudrate, this speeds up things a bit
This commit is contained in:
parent
23d61681a4
commit
66c1fd53cb
11
jtagkey.c
11
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) {
|
||||
|
Reference in New Issue
Block a user