[tuxdroid-svn] r1049 - in firmware/fuxusb/branches/HID: . modules/fifo modules/spi modules/usb modu
Status: Beta
Brought to you by:
ks156
From: Paul_R <c2m...@c2...> - 2008-04-30 14:20:03
|
Author: Paul_R Date: 2008-04-30 16:20:00 +0200 (Wed, 30 Apr 2008) New Revision: 1049 Modified: firmware/fuxusb/branches/HID/global.c firmware/fuxusb/branches/HID/global.h firmware/fuxusb/branches/HID/modules/fifo/fifo_mic.c firmware/fuxusb/branches/HID/modules/spi/spi_task.c firmware/fuxusb/branches/HID/modules/usb/usb_task.c firmware/fuxusb/branches/HID/modules/usb_enum/USB_ENUM.H firmware/fuxusb/branches/HID/modules/usb_enum/usb_enum.c Log: * Typo : replaced tab by spaces Modified: firmware/fuxusb/branches/HID/global.c =================================================================== --- firmware/fuxusb/branches/HID/global.c 2008-04-30 13:29:49 UTC (rev 1048) +++ firmware/fuxusb/branches/HID/global.c 2008-04-30 14:20:00 UTC (rev 1049) @@ -29,17 +29,17 @@ //------------------------------------------------------- // SPI Controler //------------------------------------------------------- -bit spi_task_on_Flag; // = 1; // to turn ON the RF Task -// = 0; // to turn OFF the RF Task +bit spi_task_on_Flag; // = 1; // to turn ON the RF Task +// = 0; // to turn OFF the RF Task //------------------------------------------------------- // USB Controler //------------------------------------------------------- -unsigned int usb_sof_counter; -unsigned char usb_configuration_nb; -bit usb_connected_Flag; +unsigned int usb_sof_counter; +unsigned char usb_configuration_nb; +bit usb_connected_Flag; -bit CMD_OUT_Bank_Nb; // To store the number of the Bank used for the CMD_OUT Endpoint -unsigned char CMD_IN_Bank_Nb; +bit CMD_OUT_Bank_Nb; // To store the number of the Bank used for the CMD_OUT Endpoint +unsigned char CMD_IN_Bank_Nb; bit USB_ParserProcess_Permit_Flag; bit USB_StatusProcess_Permit_Flag; @@ -49,8 +49,8 @@ // I2C Controler //------------------------------------------------------- -unsigned char i2c_wait_counter = 0; -bit i2c_task_on_Flag; +unsigned char i2c_wait_counter = 0; +bit i2c_task_on_Flag; //------------------------------------------------------- // RF Controler @@ -58,13 +58,13 @@ // RF Header //------------------------------------------------------- -#define RF_2FRAMES_HDR 0x80 -#define RF_AUDIO_HDR 0x02 -#define RF_CMD_HDR 0x08 +#define RF_2FRAMES_HDR 0x80 +#define RF_AUDIO_HDR 0x02 +#define RF_CMD_HDR 0x08 //------------------------------------------------------- -bit RF_OFFLine_Back; +bit RF_OFFLine_Back; unsigned char RF_Status; unsigned char RF_Status_Temp; @@ -76,21 +76,21 @@ // From USB //------------------------------------------------------- -unsigned char USBCommand_ForDongle[65]; // For Dongle -unsigned char USBCommand_ForRF[65]; // For RF -unsigned char USBCommand_Ctr; // Store the number of byte sent by the LIBUSB -bit USBCommand_NewRequest_Flag; -unsigned char USBCommand_Header; // Needed to analyze the LIBUSB command : to RF or to I2C +unsigned char USBCommand_ForDongle[65]; // For Dongle +unsigned char USBCommand_ForRF[65]; // For RF +unsigned char USBCommand_Ctr; // Store the number of byte sent by the LIBUSB +bit USBCommand_NewRequest_Flag; +unsigned char USBCommand_Header; // Needed to analyze the LIBUSB command : to RF or to I2C -#define LIBUSB_TUX_CMD_HDR 0 -#define LIBUSB_DONGLE_CMD_HDR 1 -#define LIBUSB_BOOTLOADER_CMD_HDR 2 +#define LIBUSB_TUX_CMD_HDR 0 +#define LIBUSB_DONGLE_CMD_HDR 1 +#define LIBUSB_BOOTLOADER_CMD_HDR 2 //------------------------------------------------------- // Dongle Info //------------------------------------------------------- -code version_t info_version ={VERSION_CMD, CPU_VER_JOIN(FUXUSB_CPU_NUM, VER_MAJOR), VER_MINOR, VER_UPDATE}; -code revision_t info_revision={REVISION_CMD, REVISION_NUMBER, RELEASE_TYPE}; -code author_t info_author={AUTHOR_CMD, AUTHOR_ID, VARIATION}; +code version_t info_version ={VERSION_CMD, CPU_VER_JOIN(FUXUSB_CPU_NUM, VER_MAJOR), VER_MINOR, VER_UPDATE}; +code revision_t info_revision={REVISION_CMD, REVISION_NUMBER, RELEASE_TYPE}; +code author_t info_author={AUTHOR_CMD, AUTHOR_ID, VARIATION}; Modified: firmware/fuxusb/branches/HID/global.h =================================================================== --- firmware/fuxusb/branches/HID/global.h 2008-04-30 13:29:49 UTC (rev 1048) +++ firmware/fuxusb/branches/HID/global.h 2008-04-30 14:20:00 UTC (rev 1049) @@ -24,8 +24,8 @@ /*_____ D E F I N I T I O N ________________________________________________*/ // Hardware -#define rf_reset_signal P0_1 -#define RF_OFFLINE P2_3 +#define rf_reset_signal P0_1 +#define RF_OFFLINE P2_3 /*_____ D E C L A R A T I O N ______________________________________________*/ @@ -34,21 +34,21 @@ //------------------------------------------------------- // SPI Controler //------------------------------------------------------- -extern bit spi_task_on_Flag; // = 1; // to turn ON the RF Task -// = 0; // to turn OFF the RF Task -extern unsigned int spi_watchdog_ctr; +extern bit spi_task_on_Flag; // = 1; // to turn ON the RF Task +// = 0; // to turn OFF the RF Task +extern unsigned int spi_watchdog_ctr; #define SPI_WATCHDOG_MAX (6000) //------------------------------------------------------- // USB Controler //------------------------------------------------------- -extern unsigned int usb_sof_counter; -extern unsigned char usb_configuration_nb; -extern bit usb_connected_Flag; +extern unsigned int usb_sof_counter; +extern unsigned char usb_configuration_nb; +extern bit usb_connected_Flag; -extern bit CMD_OUT_Bank_Nb; // To store the number of the Bank used for the CMD_OUT Endpoint -extern unsigned char CMD_IN_Bank_Nb; +extern bit CMD_OUT_Bank_Nb;// To store the number of the Bank used for the CMD_OUT Endpoint +extern unsigned char CMD_IN_Bank_Nb; extern bit USB_ParserProcess_Permit_Flag; extern bit USB_StatusProcess_Permit_Flag; @@ -60,7 +60,7 @@ //------------------------------------------------------- extern unsigned char i2c_wait_counter; -extern bit i2c_task_on_Flag; +extern bit i2c_task_on_Flag; //------------------------------------------------------- // RF Controler @@ -68,13 +68,13 @@ // RF Header //------------------------------------------------------- -#define RF_2FRAMES_HDR 0x80 -#define RF_AUDIO_HDR 0x02 -#define RF_CMD_HDR 0x08 +#define RF_2FRAMES_HDR 0x80 +#define RF_AUDIO_HDR 0x02 +#define RF_CMD_HDR 0x08 //------------------------------------------------------- -extern bit RF_OFFLine_Back; +extern bit RF_OFFLine_Back; extern unsigned char RF_Status; extern unsigned char RF_Status_Temp; @@ -86,17 +86,17 @@ // From USB //------------------------------------------------------- -extern unsigned char USBCommand_ForRF[]; // Store the USB Command -extern unsigned char USBCommand_ForDongle[]; // For Dongle -extern unsigned char USBCommand_Ctr; // Store the number of byte sent by the LIBUSB +extern unsigned char USBCommand_ForRF[]; // Store the USB Command +extern unsigned char USBCommand_ForDongle[]; // For Dongle +extern unsigned char USBCommand_Ctr; // Store the number of byte sent by the LIBUSB -extern bit USBCommand_NewRequest_Flag; -extern unsigned char USBCommand_Header; // Needed to analyze the LIBUSB command : to RF or to I2C +extern bit USBCommand_NewRequest_Flag; +extern unsigned char USBCommand_Header; // Needed to analyze the LIBUSB command : to RF or to I2C -#define LIBUSB_TUX_CMD_HDR 0 -#define LIBUSB_DONGLE_CMD_HDR 1 -#define LIBUSB_BOOTLOADER_CMD_HDR 2 +#define LIBUSB_TUX_CMD_HDR 0 +#define LIBUSB_DONGLE_CMD_HDR 1 +#define LIBUSB_BOOTLOADER_CMD_HDR 2 @@ -104,8 +104,8 @@ // Dongle Info //------------------------------------------------------- -extern code version_t info_version; -extern code revision_t info_revision; -extern code author_t info_author; +extern code version_t info_version; +extern code revision_t info_revision; +extern code author_t info_author; #endif /* _GLOBAL_H_ */ Modified: firmware/fuxusb/branches/HID/modules/fifo/fifo_mic.c =================================================================== --- firmware/fuxusb/branches/HID/modules/fifo/fifo_mic.c 2008-04-30 13:29:49 UTC (rev 1048) +++ firmware/fuxusb/branches/HID/modules/fifo/fifo_mic.c 2008-04-30 14:20:00 UTC (rev 1049) @@ -19,7 +19,7 @@ //------------------------------------------------------------------------ -#define FIFOTBL_MIC_MAX 256 +#define FIFOTBL_MIC_MAX 256 #define FIFO_MIC_OVERLOAD FIFOTBL_MIC_MAX + 1 Modified: firmware/fuxusb/branches/HID/modules/spi/spi_task.c =================================================================== --- firmware/fuxusb/branches/HID/modules/spi/spi_task.c 2008-04-30 13:29:49 UTC (rev 1048) +++ firmware/fuxusb/branches/HID/modules/spi/spi_task.c 2008-04-30 14:20:00 UTC (rev 1049) @@ -33,9 +33,9 @@ data unsigned char spi_count; data unsigned char spi_lenght_data; -bit spi_enable = 1; -bit spi_ready = 0; -bit spi_Start_Flag = 0; +bit spi_enable = 1; +bit spi_ready = 0; +bit spi_Start_Flag = 0; unsigned char spi_TestCtr ; // Debug @@ -91,33 +91,33 @@ #ifdef X2_MODE Set_spi_x2_mode(); #endif - SPCON |= MSK_MSTR; /* Master mode */ + SPCON |= MSK_MSTR; /* Master mode */ #ifdef SPI_Clock_Div128 SPCON |= 0x82; /* Fclk Periph/128 */ #endif #ifdef SPI_Clock_Div4 - SPCON |= 0x01; /* Fclk Periph/4 */ + SPCON |= 0x01; /* Fclk Periph/4 */ #endif #ifdef SPI_Clock_Div8 - SPCON |= 0x02; /* Fclk Periph/8 */ + SPCON |= 0x02; /* Fclk Periph/8 */ #endif #ifdef SPI_Clock_Div16 - SPCON |= 0x03; /* Fclk Periph/8 */ + SPCON |= 0x03; /* Fclk Periph/8 */ #endif - SPCON &= ~MSK_CPOL; /* CPOL=0; transmit mode example */ - SPCON &= ~MSK_CPHA; /* CPHA=0; transmit mode example */ + SPCON &= ~MSK_CPOL; /* CPOL=0; transmit mode example */ + SPCON &= ~MSK_CPHA; /* CPHA=0; transmit mode example */ SPCON |= MSK_SSDIS; - SPCON |= MSK_SPEN; /* run spi */ + SPCON |= MSK_SPEN; /* run spi */ - SPI_DREADY = 1; - SPI_START = 1; - SPI_CSn = 1; - IT0 = 1; // Falling Edge On Int0 - EX0 = 1; /* enable Int0 interrupt */ + SPI_DREADY = 1; + SPI_START = 1; + SPI_CSn = 1; + IT0 = 1; // Falling Edge On Int0 + EX0 = 1; /* enable Int0 interrupt */ - spi_slave = 0; // Reset State Machine of spi_task() - spi_master = 0; // Reset State Machine of spi_task() + spi_slave = 0; // Reset State Machine of spi_task() + spi_master = 0; // Reset State Machine of spi_task() spi_task_on_Flag = 0; } Modified: firmware/fuxusb/branches/HID/modules/usb/usb_task.c =================================================================== --- firmware/fuxusb/branches/HID/modules/usb/usb_task.c 2008-04-30 13:29:49 UTC (rev 1048) +++ firmware/fuxusb/branches/HID/modules/usb/usb_task.c 2008-04-30 14:20:00 UTC (rev 1049) @@ -42,13 +42,13 @@ unsigned char pong_received; /* value of the pong received from the sound cpu */ unsigned char pong_missed; /* counting the pong missed on the SPI */ #endif -bit EP_AUDIOIN_Loaded = 0; -bit i2c_bootloading_Flag = 0; /* bootloader mode */ +bit EP_AUDIOIN_Loaded = 0; +bit i2c_bootloading_Flag = 0; /* bootloader mode */ uint16_t address_tracking; -bit ReadStatus_USBRequest_Flag = 0; -bit Cpu_reset = 0; -bit Speaker_TTS_Select_Flag = 0; +bit ReadStatus_USBRequest_Flag = 0; +bit Cpu_reset = 0; +bit Speaker_TTS_Select_Flag = 0; fifo_t statusBuf; fifo_t *statusFifo = &statusBuf; @@ -207,22 +207,22 @@ void usb_Bootloader_command_process_task(void) { data Uchar i; - if((USB_Bootloader_NewCmd_Flag) && (CMD_IN_Bank_Nb < 2)) - { + if((USB_Bootloader_NewCmd_Flag) && (CMD_IN_Bank_Nb < 2)) + { Usb_select_ep(EP_CMD_IN); #ifdef BOOTLOAD_USB_DEBUG - printf ("BUSB: TX ready, UEPSTAX=0x%BX\n", UEPSTAX); + printf ("BUSB: TX ready, UEPSTAX=0x%BX\n", UEPSTAX); #endif - for(i=0;i<FifoIn_STT_Idx;i++) - { - Usb_write_byte(FIFO_STT_get()); - } + for(i=0;i<FifoIn_STT_Idx;i++) + { + Usb_write_byte(FIFO_STT_get()); + } FIFO_STT_flush(); CMD_IN_Bank_Nb ++; // Increase the bank number - USB_Bootloader_NewCmd_Flag = FALSE; + USB_Bootloader_NewCmd_Flag = FALSE; data_to_send(); - } + } } void data_to_send(void) @@ -256,7 +256,7 @@ FIFO_STT_put(p1); FIFO_STT_put(p2); FIFO_STT_put(p3); - USB_Bootloader_NewCmd_Flag = TRUE; + USB_Bootloader_NewCmd_Flag = TRUE; usb_Bootloader_command_process_task(); } @@ -305,9 +305,9 @@ USB_Status_NewCmd_Flag = TRUE; //DEBUG_2 = 0; } - // Complete reset - //////////////////////////////////////// - if(USBCommand_ForDongle[3] == 0xfe) + // Complete reset + //////////////////////////////////////// + if(USBCommand_ForDongle[3] == 0xfe) { //--------------------------- IEN0 = 0; @@ -370,7 +370,7 @@ while (data_length > i) { - if (commands[i] == INFO_FUXUSB_CMD) // + if (commands[i] == INFO_FUXUSB_CMD) { // VERSION_CMD //------------------------------------- @@ -615,8 +615,8 @@ CMD_IN_Bank_Nb--; if (CMD_IN_Bank_Nb<0) CMD_IN_Bank_Nb = 0; - if (CMD_IN_Bank_Nb != 0) - Usb_set_tx_ready(); + if (CMD_IN_Bank_Nb != 0) + Usb_set_tx_ready(); } } @@ -660,7 +660,7 @@ i=8; do { - FIFO_SPK_put(Usb_read_byte()); // Use Only one Call to Get 8 Bytes + FIFO_SPK_put(Usb_read_byte());// Use Only one Call to Get 8 Bytes i--; }while(i); } @@ -736,8 +736,8 @@ //DEBUG_2 = 0; if(Usb_rx_complete()) { - USBCommand_Ctr = usb_get_nb_byte(); // Capture the number of Byte in USB FIFO - USBCommand_Header = Usb_read_byte(); // Read the Header + USBCommand_Ctr = usb_get_nb_byte(); // Capture the number of Byte in USB FIFO + USBCommand_Header = Usb_read_byte(); // Read the Header //-------------------------------------------------------------------------- // Modified: firmware/fuxusb/branches/HID/modules/usb_enum/USB_ENUM.H =================================================================== --- firmware/fuxusb/branches/HID/modules/usb_enum/USB_ENUM.H 2008-04-30 13:29:49 UTC (rev 1048) +++ firmware/fuxusb/branches/HID/modules/usb_enum/USB_ENUM.H 2008-04-30 14:20:00 UTC (rev 1049) @@ -44,15 +44,15 @@ /*_____ A U D I O C L A S S R E Q U E S T S_____________________________*/ -#define SET_CURRENT 0x01 -#define SET_MIN 0x02 -#define SET_MAX 0x03 -#define SET_RES 0x04 +#define SET_CURRENT 0x01 +#define SET_MIN 0x02 +#define SET_MAX 0x03 +#define SET_RES 0x04 -#define GET_CURRENT 0x81 -#define GET_MIN 0x82 -#define GET_MAX 0x83 -#define GET_RES 0x84 +#define GET_CURRENT 0x81 +#define GET_MIN 0x82 +#define GET_MAX 0x83 +#define GET_RES 0x84 #define GET_DEVICE_DESCRIPTOR 1 @@ -113,19 +113,19 @@ /*_____ E N D P O I N T _____________________________________________*/ -#define OUT_ENDPOINT1 0x01 -#define OUT_ENDPOINT2 0x02 -#define OUT_ENDPOINT3 0x03 -#define OUT_ENDPOINT4 0x04 -#define OUT_ENDPOINT5 0x05 -#define OUT_ENDPOINT6 0x06 +#define OUT_ENDPOINT1 0x01 +#define OUT_ENDPOINT2 0x02 +#define OUT_ENDPOINT3 0x03 +#define OUT_ENDPOINT4 0x04 +#define OUT_ENDPOINT5 0x05 +#define OUT_ENDPOINT6 0x06 -#define IN_ENDPOINT1 0x81 -#define IN_ENDPOINT2 0x82 -#define IN_ENDPOINT3 0x83 -#define IN_ENDPOINT4 0x84 -#define IN_ENDPOINT5 0x85 -#define IN_ENDPOINT6 0x86 +#define IN_ENDPOINT1 0x81 +#define IN_ENDPOINT2 0x82 +#define IN_ENDPOINT3 0x83 +#define IN_ENDPOINT4 0x84 +#define IN_ENDPOINT5 0x85 +#define IN_ENDPOINT6 0x86 /*_________________________________________________________ S T R U C T _____*/ /*_____ U S B D E V I C E R E Q U E S T _________________________________*/ @@ -182,10 +182,10 @@ struct usb_hid_descriptor { - Uchar bLength; /* size of this descriptor in bytes */ - Uchar bDescriptorType; /* INTERFACE descriptor type */ - Uint16 bcdHID; /* HID spec. */ - Uchar bCountryCode; /* Country code value*/ + Uchar bLength; /* size of this descriptor in bytes */ + Uchar bDescriptorType; /* INTERFACE descriptor type */ + Uint16 bcdHID; /* HID spec. */ + Uchar bCountryCode; /* Country code value*/ Uchar bNumDescriptors; /* Number of reports descriptor */ Uchar bDescriptorTypeRep; /* Type of the class-specific descriptor */ Uint16 wDescriptorLength; /* Size of the report descriptor */ @@ -340,8 +340,8 @@ Uchar bLength; /* size of this descriptor in bytes */ Uchar bDescriptorType; /* INTERFACE descriptor type */ Uchar bDescriptorSubtype; /* HEADER descriptor subtype.*/ - Uint16 bcdADC; /* Audio Device Class Specification Release Number in Binary-Coded Decimal */ - Uint16 wTotalLength; /* Total number of bytes returned for the class-specific AudioControl interface descriptor */ + Uint16 bcdADC; /* Audio Device Class Specification Release Number in Binary-Coded Decimal */ + Uint16 wTotalLength; /* Total number of bytes returned for the class-specific AudioControl interface descriptor */ Uchar bInCollection; /* Number of EP except EP 0 */ Uchar baInterfaceNr[2]; /* Class code assigned by the USB */ }; @@ -351,10 +351,10 @@ Uchar bLength; /* size of this descriptor in bytes */ Uchar bDescriptorType; /* INTERFACE descriptor type */ Uchar bDescriptorSubtype; /* HEADER descriptor subtype.*/ - Uint16 bcdADC; /* Audio Device Class Specification Release Number in Binary-Coded Decimal */ - Uint16 wTotalLength; /* Total number of bytes returned for the class-specific AudioControl interface descriptor */ - Uchar bInCollection; /* Number of EP except EP 0 */ - Uchar baInterfaceNr[1]; /* Class code assigned by the USB */ + Uint16 bcdADC; /* Audio Device Class Specification Release Number in Binary-Coded Decimal */ + Uint16 wTotalLength; /* Total number of bytes returned for the class-specific AudioControl interface descriptor */ + Uchar bInCollection; /* Number of EP except EP 0 */ + Uchar baInterfaceNr[1]; /* Class code assigned by the USB */ }; /*_____ U S B I N P U T T E R M I N A L D E S C R I P T O R ___________________________*/ @@ -364,13 +364,13 @@ Uchar bLength; /* size of this descriptor in bytes */ Uchar bDescriptorType; /* INTERFACE descriptor type */ Uchar bDescriptorSubtype; /* HEADER descriptor subtype.*/ - Uchar bTerminalID; /* CConstant characterizing the type of Termina*/ - Uint16 wTerminalType; /* Constant characterizing the type of Terminal.*/ - Uchar bAssocTerminal; /* ID of the Output Terminal to which this Input Terminal is associated */ - Uchar bNrChannels; /* Number of logical output channels in the Terminals output audio channel cluster. */ - Uint16 wChannelConfig; /* Describes the spatial location of the logical channels.*/ - Uchar iChannelNames; /*Index of a string descriptor, describing the name of the first logical channel */ - Uchar iTerminal; /*Index of a string descriptor, describing the Input Terminal. */ + Uchar bTerminalID; /* CConstant characterizing the type of Termina*/ + Uint16 wTerminalType; /* Constant characterizing the type of Terminal.*/ + Uchar bAssocTerminal; /* ID of the Output Terminal to which this Input Terminal is associated */ + Uchar bNrChannels; /* Number of logical output channels in the Terminals output audio channel cluster. */ + Uint16 wChannelConfig; /* Describes the spatial location of the logical channels.*/ + Uchar iChannelNames; /*Index of a string descriptor, describing the name of the first logical channel */ + Uchar iTerminal; /*Index of a string descriptor, describing the Input Terminal. */ }; /*_____ U S B O U T P U T T E R M I N A L D E S C R I P T O R ___________________________*/ @@ -380,11 +380,11 @@ Uchar bLength; /* size of this descriptor in bytes */ Uchar bDescriptorType; /* INTERFACE descriptor type */ Uchar bDescriptorSubtype; /* HEADER descriptor subtype.*/ - Uchar bTerminalID; /* CConstant characterizing the type of Termina*/ - Uint16 wTerminalType; /* Constant characterizing the type of Terminal.*/ - Uchar bAssocTerminal; /* ID of the Output Terminal to which this Input Terminal is associated */ - Uchar bSourceID; /*ID of the Unit or Terminal to which this Terminal is connected */ - Uchar iTerminal; /*Index of a string descriptor, describing the Input Terminal. */ + Uchar bTerminalID; /* CConstant characterizing the type of Termina*/ + Uint16 wTerminalType; /* Constant characterizing the type of Terminal.*/ + Uchar bAssocTerminal; /* ID of the Output Terminal to which this Input Terminal is associated */ + Uchar bSourceID; /*ID of the Unit or Terminal to which this Terminal is connected */ + Uchar iTerminal; /*Index of a string descriptor, describing the Input Terminal. */ }; /*_____ U S B F E A T U R E U N I T D E S C R I P T O R ___________________________*/ @@ -394,11 +394,11 @@ Uchar bLength; /* size of this descriptor in bytes */ Uchar bDescriptorType; /* INTERFACE descriptor type */ Uchar bDescriptorSubtype; /* HEADER descriptor subtype.*/ - Uchar bUnitID; /* Constant uniquely identifying the Unit within the audio function.*/ - Uchar bSourceID; /* Constant characterizing the type of Terminal.*/ - Uchar bControlSize; /* Size in bytes of an element of the bmaControls() array: n*/ - Uchar bmaControls[2]; /*ID of the Unit or Terminal to which this Terminal is connected */ - Uchar iFeature; /*Index of a string descriptor, describing this Feature Unit.. */ + Uchar bUnitID; /* Constant uniquely identifying the Unit within the audio function.*/ + Uchar bSourceID; /* Constant characterizing the type of Terminal.*/ + Uchar bControlSize; /* Size in bytes of an element of the bmaControls() array: n*/ + Uchar bmaControls[2]; /*ID of the Unit or Terminal to which this Terminal is connected */ + Uchar iFeature; /*Index of a string descriptor, describing this Feature Unit.. */ }; /*_____ U S B S T D AUDIO STREAM I N T E R F A C E D E S C R I P T O R _____________________*/ @@ -423,9 +423,9 @@ Uchar bLength; /* size of this descriptor in bytes */ Uchar bDescriptorType; /* INTERFACE descriptor type */ Uchar bDescriptorSubtype; /* AS_GENERAL descriptor subtype.*/ - Uchar bTerminalLink; /* The Terminal ID of the Terminal to which the endpoint of this interface is connected.*/ - Uchar bDelay; /* Delay (d) introduced by the data path */ - Uint16 wFormatTag; /* Class code assigned by the USB */ + Uchar bTerminalLink; /* The Terminal ID of the Terminal to which the endpoint of this interface is connected.*/ + Uchar bDelay; /* Delay (d) introduced by the data path */ + Uint16 wFormatTag; /* Class code assigned by the USB */ }; /*_____ U S B AUDIO ST E N D P O I N T D E S C R I P T O R _______________________*/ @@ -437,9 +437,9 @@ Uchar bEndpointAddress; /* Address of the endpoint */ Uchar bmAttributes; /* Endpoint's attributes */ Uint16 wMaxPacketSize; /* Maximum packet size for this EP */ - Uchar bInterval; /* Interval for polling EP in ms */ - Uchar bRefresh; /* Reset to 0.*/ - Uchar bSynchAddress; /* The address of the endpoint used to communicate synchronization information if required by this endpoint..*/ + Uchar bInterval; /* Interval for polling EP in ms */ + Uchar bRefresh; /* Reset to 0.*/ + Uchar bSynchAddress; /* The address of the endpoint used to communicate synchronization information if required by this endpoint..*/ }; /*_____ U S B AUDIO S T E N D P O I N T D E S C R I P T O R _______________________*/ @@ -451,7 +451,7 @@ Uchar bDescriptorSubtype; /* EP_GENERAL descriptor subtype. */ Uchar bmAttributes; /* Endpoint's attributes */ Uchar bLockDelayUnits; /*Indicates the units used for the wLockDelay field:*/ - Uint16 wLockDelay; /* Reset to 0.*/ + Uint16 wLockDelay; /* Reset to 0.*/ }; /*_____ U S B AUDIO S T E N D P O I N T D E S C R I P T O R _______________________*/ @@ -462,11 +462,11 @@ Uchar bDescriptorType; /* ENDPOINT descriptor type */ Uchar bDescriptorSubtype; /* EP_GENERAL descriptor subtype. */ Uchar bFormatType; /* FORMAT_TYPE_I. Constant identifying the Format Type the AudioStreaming interface is using.*/ - Uchar bNrChannels; /*Indicates the number of physical channels in the audio data stream.:*/ - Uchar bSubframeSize; /* The number of bytes occupied by one audio subframe. Can be 1, 2, 3 or 4.*/ - Uchar bBitResolution; /* The number of effectively used bits from the available bits in an audio subframe.*/ - Uchar bSamFreqType; /*Indicates how the sampling frequency can be programmed */ - Uchar bSamFreqTbl[3]; /*See sampling frequency tables*/ + Uchar bNrChannels; /*Indicates the number of physical channels in the audio data stream.:*/ + Uchar bSubframeSize; /* The number of bytes occupied by one audio subframe. Can be 1, 2, 3 or 4.*/ + Uchar bBitResolution; /* The number of effectively used bits from the available bits in an audio subframe.*/ + Uchar bSamFreqType; /*Indicates how the sampling frequency can be programmed */ + Uchar bSamFreqTbl[3]; /*See sampling frequency tables*/ }; /*_____ D E C L A R A T I O N ______________________________________________*/ Modified: firmware/fuxusb/branches/HID/modules/usb_enum/usb_enum.c =================================================================== --- firmware/fuxusb/branches/HID/modules/usb_enum/usb_enum.c 2008-04-30 13:29:49 UTC (rev 1048) +++ firmware/fuxusb/branches/HID/modules/usb_enum/usb_enum.c 2008-04-30 14:20:00 UTC (rev 1049) @@ -131,9 +131,9 @@ struct usb_Audio_cs_ASendpoint_descriptor SpkEndpointDescriptor_TTS; #endif - // Report descriptor - //------------------------------------------------------------------------- - Uchar rep[SIZE_OF_REPORT]; + // Report descriptor + //------------------------------------------------------------------------- + Uchar rep[SIZE_OF_REPORT]; } usb_configuration = { @@ -403,45 +403,45 @@ //---------------------------------------------------------------------------- // Interface 3 :: Command / Status Interface //-------------------------------------------------------------------------- - { // Interface Descriptor - 0x09, // Descriptor size - 0x04, // Descriptor type (Interface) - 0x03, // Interface number - 0x00, // Alternate setting number - 0x02, // Number of endpoints in this interface - 0x03, // Interface class (HID) - 0x00, // Interface sub-class (vendor-specific) - 0x00, // Interface protocol (vendor-specific) - 0x00 // Interface string index - }, - - { // HID Descriptor - 0x09, // Descriptor size - 0x21, // Descriptor type (HID) - 0x1001, // HID Spec (1.1) - 0x00, // Country code (undef) - 0x01, // Number of subordinate class descriptors - 0x22, // Descriptor type (report) - 0x2200 // Report descriptor size - }, + { // Interface Descriptor + 0x09, // Descriptor size + 0x04, // Descriptor type (Interface) + 0x03, // Interface number + 0x00, // Alternate setting number + 0x02, // Number of endpoints in this interface + 0x03, // Interface class (HID) + 0x00, // Interface sub-class (vendor-specific) + 0x00, // Interface protocol (vendor-specific) + 0x00 // Interface string index + }, + + { // HID Descriptor + 0x09, // Descriptor size + 0x21, // Descriptor type (HID) + 0x1001, // HID Spec (1.1) + 0x00, // Country code (undef) + 0x01, // Number of subordinate class descriptors + 0x22, // Descriptor type (report) + 0x2200 // Report descriptor size + }, - { // Endpoint Descriptor - 0x07, // Descriptor size - 0x05, // Descriptor type (Endpoint) - IN_ENDPOINT4, // Endpoint nb and direction - 0x03, // Endpoint type - 0x4000, // Maximum packet size - 0x00 // Polling interval - }, + { // Endpoint Descriptor + 0x07, // Descriptor size + 0x05, // Descriptor type (Endpoint) + IN_ENDPOINT4, // Endpoint nb and direction + 0x03, // Endpoint type + 0x4000, // Maximum packet size + 0x01 // Polling interval + }, - { // Endpoint Descriptor - 0x07, // Descriptor size - 0x05, // Descriptor type (Endpoint) - OUT_ENDPOINT5, // Endpoint nb and direction - 0x03, // Endpoint type - 0x4000, // Maximum packet size - 0x00 // Polling interval - }, + { // Endpoint Descriptor + 0x07, // Descriptor size + 0x05, // Descriptor type (Endpoint) + OUT_ENDPOINT5, // Endpoint nb and direction + 0x03, // Endpoint type + 0x4000, // Maximum packet size + 0x01 // Polling interval + }, #ifdef TTS_INTERFACE_ENABLED //---------------------------------------------------------------------------- // Audio @@ -799,9 +799,9 @@ case SET_ADDRESS: usb_set_address(); break; case SET_CONFIGURATION: /* or SET_REPORT */ - if (bmRequestType == 0) { usb_set_configuration(); } - else { usb_hid_set_report(); } - break; + if (bmRequestType == 0) { usb_set_configuration(); } + else { usb_hid_set_report(); } + break; /* case CLEAR_FEATURE: // or GET_ENCPASULATED_COMMAND // if(bmRequestType == 0xA1) { cdc_get_encapsulated_command(); } @@ -826,8 +826,8 @@ break; /* HID Specific request */ - case HID_GET_IDLE: - usb_hid_get_idle(); break; + case HID_GET_IDLE: + usb_hid_get_idle(); break; case SET_DESCRIPTOR: case SYNCH_FRAME: @@ -1144,7 +1144,7 @@ break; } - case REPORT: + case REPORT: { data_to_transfer = SIZE_OF_REPORT; pbuffer = &(usb_configuration.rep[0]); |