aboutsummaryrefslogtreecommitdiff
path: root/bootloaders/caterina/src/USBCore.cpp
diff options
context:
space:
mode:
authorZach Eveland <zeveland@blacklabel-development.com>2012-01-10 20:52:57 -0500
committerZach Eveland <zeveland@blacklabel-development.com>2012-01-10 20:52:57 -0500
commit385679caf2e6ad9502b5fe16f594225b8e82f890 (patch)
treebbd05c61d770f5b5e24ee812bcc47dc26df5163b /bootloaders/caterina/src/USBCore.cpp
parent29e4d73a55b1ba5782d9a1491ab9e1c1331a6b8a (diff)
restored composite and non-composite device descriptors (removed in 4b05c3fc7529477fb7031d42103c15b50a6b58be)
Windows wants to see both types of device descriptors.
Diffstat (limited to 'bootloaders/caterina/src/USBCore.cpp')
-rw-r--r--bootloaders/caterina/src/USBCore.cpp4
1 files changed, 3 insertions, 1 deletions
diff --git a/bootloaders/caterina/src/USBCore.cpp b/bootloaders/caterina/src/USBCore.cpp
index ac5d081..0eecacc 100644
--- a/bootloaders/caterina/src/USBCore.cpp
+++ b/bootloaders/caterina/src/USBCore.cpp
@@ -363,7 +363,9 @@ bool SendDescriptor()
#endif
} else if (USB_DEVICE_DESCRIPTOR_TYPE == t)
{
- desc_addr = (const uint8_t*)&USB_DeviceDescriptor;
+ if (setup.wLength == 8)
+ _cdcComposite = 1;
+ desc_addr = _cdcComposite ? (const uint8_t*)&USB_DeviceDescriptorA : (const uint8_t*)&USB_DeviceDescriptor;
}
else if (USB_CONFIGURATION_DESCRIPTOR_TYPE == t)
{