summaryrefslogtreecommitdiff
path: root/contrib/libftdi
diff options
context:
space:
mode:
authorntfreak <ntfreak@b42882b7-edfa-0310-969c-e2dbd0fdcd60>2008-05-02 09:35:48 +0000
committerntfreak <ntfreak@b42882b7-edfa-0310-969c-e2dbd0fdcd60>2008-05-02 09:35:48 +0000
commit8bf24de7b3e60681c302baaaa9bce4bc8e39a5c7 (patch)
tree8e4ac4779e8176bcafe74b914b9e9686a259f5ba /contrib/libftdi
parent872919e53a6cd04dcea0d94471c89b610ef4df0e (diff)
downloadopenocd+libswd-8bf24de7b3e60681c302baaaa9bce4bc8e39a5c7.tar.gz
openocd+libswd-8bf24de7b3e60681c302baaaa9bce4bc8e39a5c7.tar.bz2
openocd+libswd-8bf24de7b3e60681c302baaaa9bce4bc8e39a5c7.tar.xz
openocd+libswd-8bf24de7b3e60681c302baaaa9bce4bc8e39a5c7.zip
- added info about libftdi support under win32
git-svn-id: svn://svn.berlios.de/openocd/trunk@638 b42882b7-edfa-0310-969c-e2dbd0fdcd60
Diffstat (limited to 'contrib/libftdi')
-rw-r--r--contrib/libftdi/README7
-rw-r--r--contrib/libftdi/libftdi-0.12_win32.patch20
2 files changed, 27 insertions, 0 deletions
diff --git a/contrib/libftdi/README b/contrib/libftdi/README
new file mode 100644
index 00000000..475c4e55
--- /dev/null
+++ b/contrib/libftdi/README
@@ -0,0 +1,7 @@
+libftdi can be built to work under win32 (cygwin/mingw) after applying the patch in this directory.
+
+The issue is caused by windows requiring usb_set_configuration to be called before the usb_claim_interface.
+
+Spen
+spen@spen-soft.co.uk
+
diff --git a/contrib/libftdi/libftdi-0.12_win32.patch b/contrib/libftdi/libftdi-0.12_win32.patch
new file mode 100644
index 00000000..426523c7
--- /dev/null
+++ b/contrib/libftdi/libftdi-0.12_win32.patch
@@ -0,0 +1,20 @@
+--- src/ftdi.c.orig Wed Apr 16 16:24:30 2008
++++ src/ftdi.c Thu May 01 20:19:46 2008
+@@ -358,6 +358,17 @@
+ if (usb_detach_kernel_driver_np(ftdi->usb_dev, ftdi->interface) != 0 && errno != ENODATA)
+ detach_errno = errno;
+ #endif
++
++#if defined(_WIN32) || defined(__WIN32__) || defined(__CYGWIN__)
++ if (usb_set_configuration(ftdi->usb_dev, 1) != 0) {
++ usb_close (ftdi->usb_dev);
++ if (detach_errno == EPERM) {
++ ftdi_error_return(-8, "inappropriate permissions on device!");
++ } else {
++ ftdi_error_return(-5, "unable to set configuration");
++ }
++ }
++#endif
+
+ if (usb_claim_interface(ftdi->usb_dev, ftdi->interface) != 0) {
+ usb_close (ftdi->usb_dev);