diff options
| author | Cristian Maglie <c.maglie@bug.st> | 2012-10-19 15:02:31 +0200 |
|---|---|---|
| committer | Cristian Maglie <c.maglie@bug.st> | 2012-10-19 15:02:31 +0200 |
| commit | 4fc3fc3d761b0795501005d297e4bc2b81394a1f (patch) | |
| tree | 4ddacc2af4d3b51f757891cbdca45a758af8023f | |
| parent | 0051c6e1636b0c111eb3865df1646bcd2d726789 (diff) | |
| parent | ed855244be1c69eefd8202de13d363d82bc770c0 (diff) | |
Merge branch 'master' of github.com:arduino/ARM
| -rw-r--r-- | sam/cores/arduino/USB/USBCore.cpp | 5 |
1 files changed, 4 insertions, 1 deletions
diff --git a/sam/cores/arduino/USB/USBCore.cpp b/sam/cores/arduino/USB/USBCore.cpp index a6b3191..f4607d2 100644 --- a/sam/cores/arduino/USB/USBCore.cpp +++ b/sam/cores/arduino/USB/USBCore.cpp @@ -385,11 +385,14 @@ static bool USBD_SendDescriptor(Setup& setup) if (USB_DEVICE_DESCRIPTOR_TYPE == t) { TRACE_CORE(puts("=> USBD_SendDescriptor : USB_DEVICE_DESCRIPTOR_TYPE\r\n");) - if (setup.wLength == 8) + if (setup.wLength >= 8) { _cdcComposite = 1; } desc_addr = _cdcComposite ? (const uint8_t*)&USB_DeviceDescriptorA : (const uint8_t*)&USB_DeviceDescriptor; + if( *desc_addr > setup.wLength ) { + desc_length = setup.wLength; + } } else if (USB_STRING_DESCRIPTOR_TYPE == t) { |
