X-Git-Url: http://git.linex4red.de/pub/USBasp.git/blobdiff_plain/b9b03aadb219d06fbad9d110e508db93e45461af..f9c0357b731e5ca4a5456056bbbe2e4a8a2dc9fe:/Demos/Device/ClassDriver/CDC/Descriptors.c?ds=sidebyside diff --git a/Demos/Device/ClassDriver/CDC/Descriptors.c b/Demos/Device/ClassDriver/CDC/Descriptors.c index 03e688277..5a8cc7aed 100644 --- a/Demos/Device/ClassDriver/CDC/Descriptors.c +++ b/Demos/Device/ClassDriver/CDC/Descriptors.c @@ -45,23 +45,23 @@ USB_Descriptor_Device_t PROGMEM DeviceDescriptor = { .Header = {.Size = sizeof(USB_Descriptor_Device_t), .Type = DTYPE_Device}, - + .USBSpecification = VERSION_BCD(01.10), .Class = 0x02, .SubClass = 0x00, .Protocol = 0x00, - + .Endpoint0Size = FIXED_CONTROL_ENDPOINT_SIZE, - + .VendorID = 0x03EB, .ProductID = 0x2044, .ReleaseNumber = 0x0000, - + .ManufacturerStrIndex = 0x01, .ProductStrIndex = 0x02, - .SerialNumStrIndex = NO_DESCRIPTOR, - - .NumberOfConfigurations = 1 + .SerialNumStrIndex = USE_INTERNAL_SERIAL, + + .NumberOfConfigurations = FIXED_NUM_CONFIGURATIONS }; /** Configuration descriptor structure. This descriptor, located in FLASH memory, describes the usage @@ -77,10 +77,10 @@ USB_Descriptor_Configuration_t PROGMEM ConfigurationDescriptor = .TotalConfigurationSize = sizeof(USB_Descriptor_Configuration_t), .TotalInterfaces = 2, - + .ConfigurationNumber = 1, .ConfigurationStrIndex = NO_DESCRIPTOR, - + .ConfigAttributes = (USB_CONFIG_ATTR_BUSPOWERED | USB_CONFIG_ATTR_SELFPOWERED), .MaxPowerConsumption = USB_CONFIG_POWER_MA(100) @@ -94,11 +94,11 @@ USB_Descriptor_Configuration_t PROGMEM ConfigurationDescriptor = .AlternateSetting = 0, .TotalEndpoints = 1, - + .Class = 0x02, .SubClass = 0x02, .Protocol = 0x01, - + .InterfaceStrIndex = NO_DESCRIPTOR }, @@ -137,9 +137,9 @@ USB_Descriptor_Configuration_t PROGMEM ConfigurationDescriptor = .ManagementEndpoint = { .Header = {.Size = sizeof(USB_Descriptor_Endpoint_t), .Type = DTYPE_Endpoint}, - + .EndpointAddress = (ENDPOINT_DESCRIPTOR_DIR_IN | CDC_NOTIFICATION_EPNUM), - .Attributes = EP_TYPE_INTERRUPT, + .Attributes = (EP_TYPE_INTERRUPT | ENDPOINT_ATTR_NO_SYNC | ENDPOINT_USAGE_DATA), .EndpointSize = CDC_NOTIFICATION_EPSIZE, .PollingIntervalMS = 0xFF }, @@ -163,9 +163,9 @@ USB_Descriptor_Configuration_t PROGMEM ConfigurationDescriptor = .DataOutEndpoint = { .Header = {.Size = sizeof(USB_Descriptor_Endpoint_t), .Type = DTYPE_Endpoint}, - + .EndpointAddress = (ENDPOINT_DESCRIPTOR_DIR_OUT | CDC_RX_EPNUM), - .Attributes = EP_TYPE_BULK, + .Attributes = (EP_TYPE_BULK | ENDPOINT_ATTR_NO_SYNC | ENDPOINT_USAGE_DATA), .EndpointSize = CDC_TXRX_EPSIZE, .PollingIntervalMS = 0x00 }, @@ -173,9 +173,9 @@ USB_Descriptor_Configuration_t PROGMEM ConfigurationDescriptor = .DataInEndpoint = { .Header = {.Size = sizeof(USB_Descriptor_Endpoint_t), .Type = DTYPE_Endpoint}, - + .EndpointAddress = (ENDPOINT_DESCRIPTOR_DIR_IN | CDC_TX_EPNUM), - .Attributes = EP_TYPE_BULK, + .Attributes = (EP_TYPE_BULK | ENDPOINT_ATTR_NO_SYNC | ENDPOINT_USAGE_DATA), .EndpointSize = CDC_TXRX_EPSIZE, .PollingIntervalMS = 0x00 } @@ -188,7 +188,7 @@ USB_Descriptor_Configuration_t PROGMEM ConfigurationDescriptor = USB_Descriptor_String_t PROGMEM LanguageString = { .Header = {.Size = USB_STRING_LEN(1), .Type = DTYPE_String}, - + .UnicodeString = {LANGUAGE_ID_ENG} }; @@ -199,7 +199,7 @@ USB_Descriptor_String_t PROGMEM LanguageString = USB_Descriptor_String_t PROGMEM ManufacturerString = { .Header = {.Size = USB_STRING_LEN(11), .Type = DTYPE_String}, - + .UnicodeString = L"Dean Camera" }; @@ -210,7 +210,7 @@ USB_Descriptor_String_t PROGMEM ManufacturerString = USB_Descriptor_String_t PROGMEM ProductString = { .Header = {.Size = USB_STRING_LEN(13), .Type = DTYPE_String}, - + .UnicodeString = L"LUFA CDC Demo" }; @@ -258,6 +258,6 @@ uint16_t CALLBACK_USB_GetDescriptor(const uint16_t wValue, const uint8_t wIndex, break; } - *DescriptorAddress = Address; + *DescriptorAddress = Address; return Size; }