[tuxdroid-svn] r1182 - firmware/fuxusb/trunk/src
Status: Beta
Brought to you by:
ks156
From: Paul_R <c2m...@c2...> - 2008-05-21 14:07:03
|
Author: Paul_R Date: 2008-05-21 16:07:04 +0200 (Wed, 21 May 2008) New Revision: 1182 Modified: firmware/fuxusb/trunk/src/usb_enum.c Log: * Bug : usb_enum.c -> set_interface When the interface 3 (HID interface) is set, the banks and the eps have to be cleared. Otherwise, the EPs are corrupted. The result is that the command is often ignored. This problem occurs especially with tuxup, when the dongle has to be flashed. Tuxup uses the set_interface function, even if the interface is already set. I've also added code to reset the audio EPs when the actives interfaces (alternates interfaces 1) are set. Modified: firmware/fuxusb/trunk/src/usb_enum.c =================================================================== --- firmware/fuxusb/trunk/src/usb_enum.c 2008-05-21 10:02:01 UTC (rev 1181) +++ firmware/fuxusb/trunk/src/usb_enum.c 2008-05-21 14:07:04 UTC (rev 1182) @@ -322,6 +322,53 @@ Usb_clear_DIR(); Usb_clear_rx_setup(); + /* HID interface : + * When this interface is set, reset the endpoints and the banks + */ + if(Linterface_number == 3) + { + if(LAlternateSetting == 0) + { + CMD_IN_Bank_Nb = 0; + CMD_OUT_Bank_Nb = 0; + usb_reset_endpoint(EP_CMD_IN); + usb_reset_endpoint(EP_CMD_OUT); + } + } + + /* Microphone interface : + * Reset the endpount when the active interface is set + */ + if(Linterface_number == 1) + { + if(LAlternateSetting == 1) + { + usb_reset_endpoint(IN_ENDPOINT1); + } + } + + /* Speaker interface : + * Reset the endpount when the active interface is set + */ + if(Linterface_number == 2) + { + if(LAlternateSetting == 1) + { + usb_reset_endpoint(OUT_ENDPOINT2); + } + } + + /* Speaker interface : + * Reset the endpount when the active interface is set + */ + if(Linterface_number == 5) + { + if(LAlternateSetting == 1) + { + usb_reset_endpoint(OUT_ENDPOINT3); + } + } + send_zlp(); #ifdef USB_ENUM_DEBUG |