projects
/
pub
/
USBasp.git
/ blobdiff
commit
grep
author
committer
pickaxe
?
search:
re
summary
|
shortlog
|
log
|
commit
|
commitdiff
|
tree
raw
|
inline
| side by side
Update UC3 platform driver support to use the bitmasks defined in the header files...
[pub/USBasp.git]
/
Bootloaders
/
CDC
/
Descriptors.c
diff --git
a/Bootloaders/CDC/Descriptors.c
b/Bootloaders/CDC/Descriptors.c
index
8973c4e
..
7516a7b
100644
(file)
--- a/
Bootloaders/CDC/Descriptors.c
+++ b/
Bootloaders/CDC/Descriptors.c
@@
-104,7
+104,7
@@
const USB_Descriptor_Configuration_t ConfigurationDescriptor =
.CDC_Functional_Header =
{
.CDC_Functional_Header =
{
- .Header = {.Size = sizeof(USB_
Descriptor_CDC
_FunctionalHeader_t), .Type = DTYPE_CSInterface},
+ .Header = {.Size = sizeof(USB_
CDC_Descriptor
_FunctionalHeader_t), .Type = DTYPE_CSInterface},
.Subtype = 0x00,
.CDCSpecification = VERSION_BCD(01.10),
.Subtype = 0x00,
.CDCSpecification = VERSION_BCD(01.10),
@@
-112,7
+112,7
@@
const USB_Descriptor_Configuration_t ConfigurationDescriptor =
.CDC_Functional_ACM =
{
.CDC_Functional_ACM =
{
- .Header = {.Size = sizeof(USB_
Descriptor_CDC
_FunctionalACM_t), .Type = DTYPE_CSInterface},
+ .Header = {.Size = sizeof(USB_
CDC_Descriptor
_FunctionalACM_t), .Type = DTYPE_CSInterface},
.Subtype = 0x02,
.Capabilities = 0x04,
.Subtype = 0x02,
.Capabilities = 0x04,
@@
-120,7
+120,7
@@
const USB_Descriptor_Configuration_t ConfigurationDescriptor =
.CDC_Functional_Union =
{
.CDC_Functional_Union =
{
- .Header = {.Size = sizeof(USB_
Descriptor_CDC
_FunctionalUnion_t), .Type = DTYPE_CSInterface},
+ .Header = {.Size = sizeof(USB_
CDC_Descriptor
_FunctionalUnion_t), .Type = DTYPE_CSInterface},
.Subtype = 0x06,
.MasterInterfaceNumber = 0,
.Subtype = 0x06,
.MasterInterfaceNumber = 0,
@@
-206,29
+206,38
@@
uint16_t CALLBACK_USB_GetDescriptor(const uint16_t wValue,
const uint8_t wIndex,
const void** const DescriptorAddress)
{
const uint8_t wIndex,
const void** const DescriptorAddress)
{
- const uint8_t DescriptorType = (wValue >> 8);
- const uint8_t DescriptorNumber = (wValue & 0xFF);
+ const uint8_t
DescriptorType = (wValue >> 8);
+ const uint8_t
DescriptorNumber = (wValue & 0xFF);
const void* Address = NULL;
const void* Address = NULL;
+ uint16_t Size = NO_DESCRIPTOR;
switch (DescriptorType)
{
case DTYPE_Device:
Address = &DeviceDescriptor;
switch (DescriptorType)
{
case DTYPE_Device:
Address = &DeviceDescriptor;
+ Size = sizeof(USB_Descriptor_Device_t);
break;
case DTYPE_Configuration:
Address = &ConfigurationDescriptor;
break;
case DTYPE_Configuration:
Address = &ConfigurationDescriptor;
+ Size = sizeof(USB_Descriptor_Configuration_t);
break;
case DTYPE_String:
if (!(DescriptorNumber))
break;
case DTYPE_String:
if (!(DescriptorNumber))
- Address = &LanguageString;
+ {
+ Address = &LanguageString;
+ Size = LanguageString.Header.Size;
+ }
else
else
- Address = &ProductString;
+ {
+ Address = &ProductString;
+ Size = ProductString.Header.Size;
+ }
break;
}
*DescriptorAddress = Address;
break;
}
*DescriptorAddress = Address;
- return
(Address != NULL) ? ((USB_Descriptor_Header_t*)Address)->Size : NO_DESCRIPTOR
;
+ return
Size
;
}
}