Is there a conditional compile flag for LIBUSB 0.1?

On Thu, Sep 11, 2014 at 9:35 PM, Xiaofan Chen <[email protected]> wrote:

> On Thu, Sep 11, 2014 at 11:15 PM, Anders Oleson <[email protected]>
> wrote:
> > My "crude" fix was just to comment out 1740 and that works but only if we
> > get rid of the reset on line 1718 also. After that reset Linux appears to
> > re-call set_configuration, or the reset itself is the problem.
>
> Actually IMHO the whole section from line 1705 to line 1736 can be
> eliminated. They are just a clutch of code fixing older J-Link firmware
> versions and older libusb-0.1 problems. Of course tests need to be
> done for different J-Link HW versions but I tend to believe we should
> not care too much about really old systems.
>
> And link 1740 can be eliminated except for libusb-0.1 API users
> under Windows using libusb0.sys (especially the filter driver) as per
> previous email.
>
> 1704
> 1705 /* BE ***VERY CAREFUL*** ABOUT MAKING CHANGES IN THIS
> 1706 * AREA!!!!!!!!!!! The behavior of libusb is not completely
> 1707 * consistent across Windows, Linux, and Mac OS X platforms.
> 1708 * The actions taken in the following compiler conditionals may
> 1709 * not agree with published documentation for libusb, but were
> 1710 * found to be necessary through trials and tribulations. Even
> 1711 * little tweaks can break one or more platforms, so if you do
> 1712 * make changes test them carefully on all platforms before
> 1713 * committing them!
> 1714 */
> 1715
> 1716 #if IS_WIN32 == 0
> 1717
> 1718 jtag_libusb_reset_device(devh);
> 1719
> 1720 #if IS_DARWIN == 0
> 1721
> 1722 int timeout = 5;
> 1723 /* reopen jlink after usb_reset
> 1724 * on win32 this may take a second or two to re-enumerate */
> 1725 int retval;
> 1726 while ((retval = jtag_libusb_open(vids, pids, &devh)) != ERROR_OK) {
> 1727 usleep(1000);
> 1728 timeout--;
> 1729 if (!timeout)
> 1730 break;
> 1731 }
> 1732 if (ERROR_OK != retval)
> 1733 return NULL;
> 1734 #endif
> 1735
> 1736 #endif
> 1737
> 1738 /* usb_set_configuration required under win32 */
> 1739 struct jtag_libusb_device *udev = jtag_libusb_get_device(devh);
> 1740 jtag_libusb_set_configuration(devh, 0);
> 1741 jtag_libusb_claim_interface(devh, 0);
> 1742
>
>
> --
> Xiaofan
>
------------------------------------------------------------------------------
Want excitement?
Manually upgrade your production database.
When you want reliability, choose Perforce
Perforce version control. Predictably reliable.
http://pubads.g.doubleclick.net/gampad/clk?id=157508191&iu=/4140/ostg.clktrk
_______________________________________________
OpenOCD-devel mailing list
[email protected]
https://lists.sourceforge.net/lists/listinfo/openocd-devel

Reply via email to