diff options
author | kc8apf <kc8apf@b42882b7-edfa-0310-969c-e2dbd0fdcd60> | 2009-05-18 17:23:52 +0000 |
---|---|---|
committer | kc8apf <kc8apf@b42882b7-edfa-0310-969c-e2dbd0fdcd60> | 2009-05-18 17:23:52 +0000 |
commit | 9b4295b059493ec1d4902f9a59f4a98594ec14f9 (patch) | |
tree | c686943521e4caa8132cb25a010a5944fc44b98e | |
parent | 4528fa49f5b9937c4bdb47347a8a4c8d5912fd14 (diff) | |
download | openocd+libswd-9b4295b059493ec1d4902f9a59f4a98594ec14f9.tar.gz openocd+libswd-9b4295b059493ec1d4902f9a59f4a98594ec14f9.tar.bz2 openocd+libswd-9b4295b059493ec1d4902f9a59f4a98594ec14f9.tar.xz openocd+libswd-9b4295b059493ec1d4902f9a59f4a98594ec14f9.zip |
ftdi_set_interface correctness by Strontium <strntydog@gmail.com>
git-svn-id: svn://svn.berlios.de/openocd/trunk@1814 b42882b7-edfa-0310-969c-e2dbd0fdcd60
-rw-r--r-- | src/jtag/ft2232.c | 12 |
1 files changed, 6 insertions, 6 deletions
diff --git a/src/jtag/ft2232.c b/src/jtag/ft2232.c index 27ad2ed2..930795be 100644 --- a/src/jtag/ft2232.c +++ b/src/jtag/ft2232.c @@ -1766,6 +1766,12 @@ static int ft2232_init_libftdi(u16 vid, u16 pid, int more, int* try_more) if (ftdi_init(&ftdic) < 0) return ERROR_JTAG_INIT_FAILED; + if (ftdi_set_interface(&ftdic, INTERFACE_A) < 0) + { + LOG_ERROR("unable to select FT2232 channel A: %s", ftdic.error_str); + return ERROR_JTAG_INIT_FAILED; + } + /* context, vendor id, product id */ if (ftdi_usb_open_desc(&ftdic, vid, pid, ft2232_device_desc, ft2232_serial) < 0) @@ -1779,12 +1785,6 @@ static int ft2232_init_libftdi(u16 vid, u16 pid, int more, int* try_more) return ERROR_JTAG_INIT_FAILED; } - if (ftdi_set_interface(&ftdic, INTERFACE_A) < 0) - { - LOG_ERROR("unable to select FT2232 channel A: %s", ftdic.error_str); - return ERROR_JTAG_INIT_FAILED; - } - if (ftdi_usb_reset(&ftdic) < 0) { LOG_ERROR("unable to reset ftdi device"); |