[PATCH] Proper initialisation of interface A.
Vladimir Yakovlev <nagos <at> inbox.ru>
2010-12-23 13:05:42 GMT
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.
---
src/ftdi.c | 10 +++++-----
1 files changed, 5 insertions(+), 5 deletions(-)
diff --git a/src/ftdi.c b/src/ftdi.c
index 9cf425f..b0415eb 100644
--- a/src/ftdi.c
+++ b/src/ftdi.c
<at> <at> -133,10 +133,7 <at> <at> 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;
<at> <at> -202,7 +199,10 <at> <at> 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;
(Continue reading)