On Sun, 2014-09-21 at 23:42 +0800, Chen-Yu Tsai wrote:
> FEL mode on the A80 changed the bulk transfer endpoint.
> 
> Let the fel utility look for the endpoint addresses instead
> of hard-coding them.

Wow, the library really doesn't go out of its way to make this easy for
you, does it! Thanks for doing it. LGTM, FWIW.

> +                             // Test for bulk transfer endpoint
> +                             if ((ep->bmAttributes & 
> LIBUSB_TRANSFER_TYPE_MASK) !=
> +                                             LIBUSB_TRANSFER_TYPE_BULK)
> +                                     continue;
> +
> +                             if ((ep->bEndpointAddress & 
> LIBUSB_ENDPOINT_DIR_MASK) ==
> +                                             LIBUSB_ENDPOINT_IN)
> +                                     AW_USB_FEL_BULK_EP_IN = 
> ep->bEndpointAddress;
> +                             else
> +                                     AW_USB_FEL_BULK_EP_OUT = 
> ep->bEndpointAddress;

Local convenient vars like:
        const ... attr_type = ep->bmAttributes &
        LIBUSB_TRANSFER_TYPE_MASK
and
        const ... addr_dir = ep->bEndpointAddress &
        LIBUSB_ENDPOINT_DIR_MASK
might just shorten these enough that you can avoid the unfortunate
wrapping. Not sure it is worth it though.

Ian.

-- 
You received this message because you are subscribed to the Google Groups 
"linux-sunxi" group.
To unsubscribe from this group and stop receiving emails from it, send an email 
to [email protected].
For more options, visit https://groups.google.com/d/optout.

Reply via email to