From 3e9ef444018f64f2eee76909a602dfb440d87ee5 Mon Sep 17 00:00:00 2001 From: Claudio Indellicati Date: Thu, 18 Oct 2012 21:42:16 +0200 Subject: [PATCH] Fixed native USB serial port not appearing on Mac OS X 10.6.8. --- hardware/arduino/sam/cores/arduino/USB/USBCore.cpp | 5 ++++- 1 file changed, 4 insertions(+), 1 deletion(-) diff --git a/hardware/arduino/sam/cores/arduino/USB/USBCore.cpp b/hardware/arduino/sam/cores/arduino/USB/USBCore.cpp index a6b319180..f4607d2f0 100644 --- a/hardware/arduino/sam/cores/arduino/USB/USBCore.cpp +++ b/hardware/arduino/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) {