From 63a86b67ca5944ce7ecee1af861a90d72e7af51d Mon Sep 17 00:00:00 2001
From: Zach Eveland <zeveland@blacklabel-development.com>
Date: Tue, 10 Jan 2012 16:09:56 -0500
Subject: changed USB PID for Leonardo and Micro bootloaders

sketch and bootloader will use different PIDs to distinguish one from the other.
---
 bootloaders/diskloader/DiskLoader-Leonardo.hex |  2 +-
 bootloaders/diskloader/Makefile                | 20 ++++++++++----------
 bootloaders/diskloader/src/Platform.h          |  4 ++--
 bootloaders/diskloader/src/USBDesc.cpp         |  4 ++--
 4 files changed, 15 insertions(+), 15 deletions(-)

(limited to 'bootloaders')

diff --git a/bootloaders/diskloader/DiskLoader-Leonardo.hex b/bootloaders/diskloader/DiskLoader-Leonardo.hex
index af819fb..95ca57b 100644
--- a/bootloaders/diskloader/DiskLoader-Leonardo.hex
+++ b/bootloaders/diskloader/DiskLoader-Leonardo.hex
@@ -10,7 +10,7 @@
 :1078900074006C006F0061006400650072001803E2
 :1078A000410072006400750069006E006F002000E6
 :1078B0004C004C0043001201000202000040412332
-:1078C000340000010002030109024B0002010080A4
+:1078C000300000010002030109024B0002010080A8
 :1078D00032080B000202020100090400000102024A
 :1078E0000000052400100105240101010424020206
 :1078F000052406000107058103100040090401006A
diff --git a/bootloaders/diskloader/Makefile b/bootloaders/diskloader/Makefile
index 6ac3db3..ed4ba78 100644
--- a/bootloaders/diskloader/Makefile
+++ b/bootloaders/diskloader/Makefile
@@ -9,21 +9,22 @@ CC = avr-gcc
 
 # BOARD2
 MCU = atmega32u4
-AVR_FREQ   = 16000000L
+AVR_FREQ = 16000000L
 
-# Specify the Arduino model using the assigned PID.  This is used by Descriptors.c
-#   to set PID and product descriptor string
-# Arduino Leonardo PID
-ARDUINO_MODEL_PID = 0x0034
-# Arduino Micro PID
-#ARDUINO_MODEL_PID = 0x0035
+# Specify the Arduino model using the assigned PID.  This is used by Descriptors.c
+#   to set PID and product descriptor string
+
+# Arduino Leonardo bootloader PID 
+ARDUINO_MODEL_PID = 0x0030
+# Arduino Micro bootloader PID
+#ARDUINO_MODEL_PID = 0x0031
 
 # Change if your programmer is different
 AVRDUDE_PROGRAMMER = avrispmkII
 AVRDUDE_PORT = usb	   
 
 # program name should not be changed...
-PROGRAM    = DiskLoader
+PROGRAM = DiskLoader
 
 AVRDUDE = avrdude
 AVRDUDE_FLAGS = -p $(MCU) -P $(AVRDUDE_PORT) -c $(AVRDUDE_PROGRAMMER) -p $(MCU)
@@ -43,7 +44,6 @@ LDFLAGS = $(COMMON)
 LDFLAGS += -Wl,-gc-sections,-Map=DiskLoader.map,--section-start=.text=0x7800,--relax
 LDFLAGS += -nodefaultlibs -nostartfiles
 
-
 ## Intel Hex file production flags
 HEX_EEPROM_FLAGS = -j .eeprom
 HEX_EEPROM_FLAGS += --set-section-flags=.eeprom="alloc,load"
@@ -102,4 +102,4 @@ size: $(TARGET)
 #	@avr-size -C --mcu=${MCU} ${TARGET}.elf
 
 program: $(TARGET).hex
-	$(AVRDUDE) $(AVRDUDE_FLAGS) -B 5 -u -U flash:w:$(TARGET).hex
\ No newline at end of file
+	$(AVRDUDE) $(AVRDUDE_FLAGS) -B 1 -u -U flash:w:$(TARGET).hex
\ No newline at end of file
diff --git a/bootloaders/diskloader/src/Platform.h b/bootloaders/diskloader/src/Platform.h
index 57dc7d5..9d18e80 100644
--- a/bootloaders/diskloader/src/Platform.h
+++ b/bootloaders/diskloader/src/Platform.h
@@ -14,8 +14,8 @@
 #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 0x0034
-#define USB_PID_MICRO 0x0035
+#define USB_PID_LEONARDO_BOOTLOADER 0x0030
+#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/diskloader/src/USBDesc.cpp b/bootloaders/diskloader/src/USBDesc.cpp
index 7160868..a634d4d 100644
--- a/bootloaders/diskloader/src/USBDesc.cpp
+++ b/bootloaders/diskloader/src/USBDesc.cpp
@@ -34,9 +34,9 @@ const uint16_t STRING_SERIAL[13] = {
 
 const uint16_t STRING_IPRODUCT[28] = {
 	(3<<8) | (2+2*27),
-#if USB_PID == USB_PID_LEONARDO	
+#if USB_PID == USB_PID_LEONARDO_BOOTLOADER
 	'A','r','d','u','i','n','o',' ','L','e','o','n','a','r','d','o',' ','b','o','o','t','l','o','a','d','e','r'
-#elif USB_PID == USB_PID_MICRO
+#elif USB_PID == USB_PID_MICRO_BOOTLOADER
 	'A','r','d','u','i','n','o',' ','M','i','c','r','o',' ','b','o','o','t','l','o','a','d','e','r',' ',' ',' '
 #endif
 };
-- 
cgit v1.2.3-18-g5258