Browse Source

ftdi_set_interface correctness by Strontium <strntydog@gmail.com>

git-svn-id: svn://svn.berlios.de/openocd/trunk@1814 b42882b7-edfa-0310-969c-e2dbd0fdcd60
tags/v0.2.0
kc8apf 15 years ago
parent
commit
9b4295b059
1 changed files with 6 additions and 6 deletions
  1. +6
    -6
      src/jtag/ft2232.c

+ 6
- 6
src/jtag/ft2232.c View File

@@ -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");


Loading…
Cancel
Save