Skip to content

Commit 3e9ef44

Browse files
committed
Fixed native USB serial port not appearing on Mac OS X 10.6.8.
1 parent 05a2d77 commit 3e9ef44

File tree

1 file changed

+4
-1
lines changed

1 file changed

+4
-1
lines changed

hardware/arduino/sam/cores/arduino/USB/USBCore.cpp

Lines changed: 4 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -385,11 +385,14 @@ static bool USBD_SendDescriptor(Setup& setup)
385385
if (USB_DEVICE_DESCRIPTOR_TYPE == t)
386386
{
387387
TRACE_CORE(puts("=> USBD_SendDescriptor : USB_DEVICE_DESCRIPTOR_TYPE\r\n");)
388-
if (setup.wLength == 8)
388+
if (setup.wLength >= 8)
389389
{
390390
_cdcComposite = 1;
391391
}
392392
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+
}
393396
}
394397
else if (USB_STRING_DESCRIPTOR_TYPE == t)
395398
{

0 commit comments

Comments
 (0)