The branch, master has been updated
via 783b771a29aa6fa7e93b56b08b1c93ec14d16af4 (commit)
from d042a09782ec18d4009300b6fe4d5dd57cc2061b (commit)
- Log -----------------------------------------------------------------
commit 783b771a29aa6fa7e93b56b08b1c93ec14d16af4
Author: Vladimir Yakovlev <nagos@xxxxxxxx>
Date: Thu Dec 23 16:05:42 2010 +0300
Proper initialisation of interface A.
Write correct ftdi->in_ep and others when initialising interface A.
Without it you can not switch back to interface A, after B.
In sequence A-B-A, B stuck forewer.
-----------------------------------------------------------------------
Summary of changes:
src/ftdi.c | 10 +++++-----
1 files changed, 5 insertions(+), 5 deletions(-)
diff --git a/src/ftdi.c b/src/ftdi.c
index 30b5b55..b248c47 100644
--- a/src/ftdi.c
+++ b/src/ftdi.c
@@ -93,10 +93,7 @@ int ftdi_init(struct ftdi_context *ftdi)
ftdi->writebuffer_chunksize = 4096;
ftdi->max_packet_size = 0;
- ftdi->interface = 0;
- ftdi->index = 0;
- ftdi->in_ep = 0x02;
- ftdi->out_ep = 0x81;
+ ftdi_set_interface(ftdi, INTERFACE_ANY);
ftdi->bitbang_mode = 1; /* when bitbang is enabled this holds the number
of the mode */
ftdi->error_str = NULL;
@@ -149,7 +146,10 @@ int ftdi_set_interface(struct ftdi_context *ftdi, enum
ftdi_interface interface)
{
case INTERFACE_ANY:
case INTERFACE_A:
- /* ftdi_usb_open_desc cares to set the right index, depending on
the found chip */
+ ftdi->interface = 0;
+ ftdi->index = INTERFACE_A;
+ ftdi->in_ep = 0x02;
+ ftdi->out_ep = 0x81;
break;
case INTERFACE_B:
ftdi->interface = 1;
hooks/post-receive
--
port libftdi to libusb-1.0
--
libftdi-git - see http://www.intra2net.com/en/developer/libftdi for details.
To unsubscribe send a mail to libftdi-git+unsubscribe@xxxxxxxxxxxxxxxxxxxxxxx
|