aboutsummaryrefslogtreecommitdiff
path: root/bootloaders/diskloader/src
diff options
context:
space:
mode:
authorZach Eveland <zeveland@blacklabel-development.com>2011-11-16 16:38:22 -0500
committerZach Eveland <zeveland@blacklabel-development.com>2011-11-16 16:38:22 -0500
commit36513f8362d4ee96ec801728921e4c1e8dc29a3b (patch)
treeeeaf06289d506318e9354c4bc97ad2b03df54735 /bootloaders/diskloader/src
parented336f1b68cd537965c1294a3402769688a686ab (diff)
Leonardo bootloader now sends iSerial string during enumeration. Seems to satisfy Windows' composite device requirements.
Diffstat (limited to 'bootloaders/diskloader/src')
-rw-r--r--bootloaders/diskloader/src/Platform.h2
-rw-r--r--bootloaders/diskloader/src/USBCore.cpp2
-rw-r--r--bootloaders/diskloader/src/USBDesc.cpp9
-rw-r--r--bootloaders/diskloader/src/USBDesc.h2
4 files changed, 13 insertions, 2 deletions
diff --git a/bootloaders/diskloader/src/Platform.h b/bootloaders/diskloader/src/Platform.h
index 6acbf39..04c5b79 100644
--- a/bootloaders/diskloader/src/Platform.h
+++ b/bootloaders/diskloader/src/Platform.h
@@ -24,6 +24,8 @@ typedef unsigned long u32;
#define USB_VID 0x2341 // arduino LLC vid
#define USB_PID ARDUINO_MODEL_PID // passed in by Makefile - 0x0034 for Leonardo, 0x0035 for MIcro
+#define USB_SERIAL_STRING '0','0','0','0','0','0','0','0','1','7','0','1'
+
#define OEM_NAME 'l','e','o','n','a','r','d','o' // 8 chars
#define BOARD_INIT() DDRC |= (1<<7); DDRB |= (1<<0); DDRD |= (1<<5); CPU_PRESCALE(0); DISABLE_JTAG();
#define LED0 PORTC &= ~(1<<7)
diff --git a/bootloaders/diskloader/src/USBCore.cpp b/bootloaders/diskloader/src/USBCore.cpp
index ca74721..208121e 100644
--- a/bootloaders/diskloader/src/USBCore.cpp
+++ b/bootloaders/diskloader/src/USBCore.cpp
@@ -376,6 +376,8 @@ bool SendDescriptor()
desc_addr = (const u8*)&STRING_LANGUAGE;
else if (setup.wValueL == IPRODUCT)
desc_addr = (const u8*)&STRING_IPRODUCT;
+ else if (setup.wValueL == ISERIAL)
+ desc_addr = (const u8*)&STRING_SERIAL;
else if (setup.wValueL == IMANUFACTURER)
desc_addr = (const u8*)&STRING_IMANUFACTURER;
else
diff --git a/bootloaders/diskloader/src/USBDesc.cpp b/bootloaders/diskloader/src/USBDesc.cpp
index c8ea9c6..ade072a 100644
--- a/bootloaders/diskloader/src/USBDesc.cpp
+++ b/bootloaders/diskloader/src/USBDesc.cpp
@@ -27,6 +27,10 @@ const u16 STRING_LANGUAGE[2] = {
0x0409 // English
};
+const u16 STRING_SERIAL[13] = {
+ (3<<8) | (2+2*12),
+ USB_SERIAL_STRING
+};
const u16 STRING_IPRODUCT[28] = {
(3<<8) | (2+2*27),
@@ -44,11 +48,12 @@ const u16 STRING_IMANUFACTURER[12] = {
//#ifdef CDC_ENABLED
-DeviceDescriptor USB_DeviceDescriptorA = D_DEVICE(0X02,0X00,0X00,64,USB_VID,USB_PID,0x100,IMANUFACTURER,IPRODUCT,0,1);
+DeviceDescriptor USB_DeviceDescriptorA = D_DEVICE(0X02,0X00,0X00,64,USB_VID,USB_PID,0x100,0,IPRODUCT,ISERIAL,1);
//#else
-DeviceDescriptor USB_DeviceDescriptor = D_DEVICE(0x00,0x00,0x00,64,USB_VID,USB_PID,0x100,IMANUFACTURER,IPRODUCT,0,1);
+DeviceDescriptor USB_DeviceDescriptor = D_DEVICE(0x00,0x00,0x00,64,USB_VID,USB_PID,0x100,0,IPRODUCT,ISERIAL,1);
//#endif
+
Config USB_ConfigDescriptor =
{
D_CONFIG(sizeof(Config),INTERFACE_COUNT),
diff --git a/bootloaders/diskloader/src/USBDesc.h b/bootloaders/diskloader/src/USBDesc.h
index 094dba5..a970fa4 100644
--- a/bootloaders/diskloader/src/USBDesc.h
+++ b/bootloaders/diskloader/src/USBDesc.h
@@ -55,9 +55,11 @@ extern DeviceDescriptor USB_DeviceDescriptorA PROGMEM;
extern const u16 STRING_LANGUAGE[2] PROGMEM;
extern const u16 STRING_IPRODUCT[28] PROGMEM;
extern const u16 STRING_IMANUFACTURER[12] PROGMEM;
+extern const u16 STRING_SERIAL[13] PROGMEM;
#define IMANUFACTURER 1
#define IPRODUCT 2
+#define ISERIAL 3
#define CDC_TX CDC_ENDPOINT_IN
#define CDC_RX CDC_ENDPOINT_OUT \ No newline at end of file