libftdi Archives

Subject: Re: [PATCH] Proper initialisation of interface A.

From: Thomas Jarosch <thomas.jarosch@xxxxxxxxxxxxx>
To: libftdi@xxxxxxxxxxxxxxxxxxxxxxx
Date: Wed, 12 Jan 2011 13:16:48 +0100
On Wednesday, 12. January 2011 12:47:34 Vladimir Yakovlev wrote:
> >> This code do nothing (tested on FT2232H). Index alyaws set to 0, even
> >> without my patch by ftdi_init()
> > 
> > ftdi_usb_open_dev() gets called after ftdi_init(). The switch should
> > set the "ftdi->index" to INTERFACE_A if "ftdi->type == TYPE_2232H" and
> > it checks for "if !(ftdi->index)". Please correct me if I'm wrong.
> > 
> > It still does the same as ftdi_set_interface(), so I'll remove it.
>
> With current version of libftdi you cant set channel A after B. Only
> way to set A is re initialise device.
> ftdi_set_interface(ftdi, INTERFACE_A);
> do nothing (see code).
> My patch intended to fix this problem.

Yes, that is absolutely correct. I was referring to this
piece of code from ftdi_usb_open_dev():

--------------------------------------------
    // Set default interface on dual/quad type chips
    switch (ftdi->type)
    {
        case TYPE_2232C:
        case TYPE_2232H:
        case TYPE_4232H:
            if (!ftdi->index)
                ftdi->index = INTERFACE_A;
            break;
        default:
            break;
    }
--------------------------------------------

Thomas

--
libftdi - see http://www.intra2net.com/en/developer/libftdi for details.
To unsubscribe send a mail to libftdi+unsubscribe@xxxxxxxxxxxxxxxxxxxxxxx   

Current Thread