aboutsummaryrefslogtreecommitdiff
path: root/bootloaders/caterina/src
diff options
context:
space:
mode:
authorZach Eveland <zeveland@blacklabel-development.com>2012-01-10 20:52:57 -0500
committerZach Eveland <zeveland@blacklabel-development.com>2012-01-10 20:52:57 -0500
commit385679caf2e6ad9502b5fe16f594225b8e82f890 (patch)
treebbd05c61d770f5b5e24ee812bcc47dc26df5163b /bootloaders/caterina/src
parent29e4d73a55b1ba5782d9a1491ab9e1c1331a6b8a (diff)
restored composite and non-composite device descriptors (removed in 4b05c3fc7529477fb7031d42103c15b50a6b58be)
Windows wants to see both types of device descriptors.
Diffstat (limited to 'bootloaders/caterina/src')
-rw-r--r--bootloaders/caterina/src/Platform.h2
-rw-r--r--bootloaders/caterina/src/USBCore.cpp4
-rw-r--r--bootloaders/caterina/src/USBDesc.cpp4
3 files changed, 6 insertions, 4 deletions
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 =
{