From: kc8apf at B. <kc...@ma...> - 2009-05-18 19:24:03
|
Author: kc8apf Date: 2009-05-18 19:23:52 +0200 (Mon, 18 May 2009) New Revision: 1814 Modified: trunk/src/jtag/ft2232.c Log: ftdi_set_interface correctness by Strontium <str...@gm...> Modified: trunk/src/jtag/ft2232.c =================================================================== --- trunk/src/jtag/ft2232.c 2009-05-18 17:20:51 UTC (rev 1813) +++ trunk/src/jtag/ft2232.c 2009-05-18 17:23:52 UTC (rev 1814) @@ -1766,6 +1766,12 @@ 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 @@ 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"); |