From 385679caf2e6ad9502b5fe16f594225b8e82f890 Mon Sep 17 00:00:00 2001 From: Zach Eveland Date: Tue, 10 Jan 2012 20:52:57 -0500 Subject: restored composite and non-composite device descriptors (removed in 4b05c3fc7529477fb7031d42103c15b50a6b58be) Windows wants to see both types of device descriptors. --- bootloaders/caterina/src/Platform.h | 2 +- bootloaders/caterina/src/USBCore.cpp | 4 +++- bootloaders/caterina/src/USBDesc.cpp | 4 ++-- 3 files changed, 6 insertions(+), 4 deletions(-) (limited to 'bootloaders/caterina/src') diff --git a/bootloaders/caterina/src/Platform.h b/bootloaders/caterina/src/Platform.h index 37c26de..75e5bc3 100644 --- a/bootloaders/caterina/src/Platform.h +++ b/bootloaders/caterina/src/Platform.h @@ -14,7 +14,7 @@ #define CPU_PRESCALE(n) (CLKPR = 0x80, CLKPR = (n)) #define DISABLE_JTAG() MCUCR = (1 << JTD) | (1 << IVCE) | (0 << PUD); MCUCR = (1 << JTD) | (0 << IVSEL) | (0 << IVCE) | (0 << PUD); -#define USB_PID_LEONARDO_BOOTLOADER 0x0030 +#define USB_PID_LEONARDO_BOOTLOADER 0x008D #define USB_PID_MICRO_BOOTLOADER 0x0031 #define USB_VID 0x2341 // arduino LLC vid #define USB_PID ARDUINO_MODEL_PID // passed in by Makefile - 0x0034 for Leonardo, 0x0035 for MIcro diff --git a/bootloaders/caterina/src/USBCore.cpp b/bootloaders/caterina/src/USBCore.cpp index ac5d081..0eecacc 100644 --- a/bootloaders/caterina/src/USBCore.cpp +++ b/bootloaders/caterina/src/USBCore.cpp @@ -363,7 +363,9 @@ bool SendDescriptor() #endif } else if (USB_DEVICE_DESCRIPTOR_TYPE == t) { - desc_addr = (const uint8_t*)&USB_DeviceDescriptor; + if (setup.wLength == 8) + _cdcComposite = 1; + desc_addr = _cdcComposite ? (const uint8_t*)&USB_DeviceDescriptorA : (const uint8_t*)&USB_DeviceDescriptor; } else if (USB_CONFIGURATION_DESCRIPTOR_TYPE == t) { diff --git a/bootloaders/caterina/src/USBDesc.cpp b/bootloaders/caterina/src/USBDesc.cpp index a634d4d..a84f3be 100644 --- a/bootloaders/caterina/src/USBDesc.cpp +++ b/bootloaders/caterina/src/USBDesc.cpp @@ -46,8 +46,8 @@ const uint16_t STRING_IMANUFACTURER[12] = { 'A','r','d','u','i','n','o',' ','L','L','C' }; - -DeviceDescriptor USB_DeviceDescriptor = D_DEVICE(0X02,0X00,0X00,64,USB_VID,USB_PID,0x100,0,IPRODUCT,ISERIAL,1); +DeviceDescriptor USB_DeviceDescriptorA = D_DEVICE(0X02,0X00,0X00,64,USB_VID,USB_PID,0x100,0,IPRODUCT,ISERIAL,1); +DeviceDescriptor USB_DeviceDescriptor = D_DEVICE(0x00,0x00,0x00,64,USB_VID,USB_PID,0x100,0,IPRODUCT,ISERIAL,1); Config USB_ConfigDescriptor = { -- cgit v1.2.3-18-g5258