From ed855244be1c69eefd8202de13d363d82bc770c0 Mon Sep 17 00:00:00 2001 From: Claudio Indellicati Date: Thu, 18 Oct 2012 21:42:16 +0200 Subject: Fixed native USB serial port not appearing on Mac OS X 10.6.8. --- sam/cores/arduino/USB/USBCore.cpp | 5 ++++- 1 file changed, 4 insertions(+), 1 deletion(-) 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) { -- cgit v1.2.3