We read every piece of feedback, and take your input very seriously.
To see all available qualifiers, see our documentation.
There was an error while loading. Please reload this page.
1 parent 05a2d77 commit 3e9ef44Copy full SHA for 3e9ef44
hardware/arduino/sam/cores/arduino/USB/USBCore.cpp
@@ -385,11 +385,14 @@ static bool USBD_SendDescriptor(Setup& setup)
385
if (USB_DEVICE_DESCRIPTOR_TYPE == t)
386
{
387
TRACE_CORE(puts("=> USBD_SendDescriptor : USB_DEVICE_DESCRIPTOR_TYPE\r\n");)
388
- if (setup.wLength == 8)
+ if (setup.wLength >= 8)
389
390
_cdcComposite = 1;
391
}
392
desc_addr = _cdcComposite ? (const uint8_t*)&USB_DeviceDescriptorA : (const uint8_t*)&USB_DeviceDescriptor;
393
+ if( *desc_addr > setup.wLength ) {
394
+ desc_length = setup.wLength;
395
+ }
396
397
else if (USB_STRING_DESCRIPTOR_TYPE == t)
398
0 commit comments