[gnoduino: 108/237] changed PIDs for Leonardo and Micro. PIDs are now defined in the Makefile



commit 05b9923ba7ad735d5889bdeaabfb147a78ad7b0b
Author: Zach Eveland <zeveland blacklabel-development com>
Date:   Thu Sep 8 09:47:17 2011 -0400

    changed PIDs for Leonardo and Micro.  PIDs are now defined in the Makefile

 arduino/bootloaders/diskloader/DiskLoader.hex |    4 ++--
 arduino/bootloaders/diskloader/Makefile       |    8 +++++++-
 arduino/bootloaders/diskloader/src/Platform.h |    4 ++--
 3 files changed, 11 insertions(+), 5 deletions(-)
---
diff --git a/arduino/bootloaders/diskloader/DiskLoader.hex b/arduino/bootloaders/diskloader/DiskLoader.hex
index ae27666..7ca0c74 100644
--- a/arduino/bootloaders/diskloader/DiskLoader.hex
+++ b/arduino/bootloaders/diskloader/DiskLoader.hex
@@ -3,8 +3,8 @@
 :1078200087020110030000C18081C106C0FF0A0069
 :107830000CA10185037508150026FF00954009017C
 :107840008102954009029102C0040309041201005B
-:10785000020200004041232000000100000101124B
-:10786000010002000000404123200000010000014F
+:107850000202000040412334000001000001011237
+:10786000010002000000404123340000010000013B
 :1078700001090264000301008032080B00020202C9
 :1078800001000904000001020200000524001001AB
 :107890000524010101042402020524060001070554
diff --git a/arduino/bootloaders/diskloader/Makefile b/arduino/bootloaders/diskloader/Makefile
index ca6e11e..6ac3db3 100644
--- a/arduino/bootloaders/diskloader/Makefile
+++ b/arduino/bootloaders/diskloader/Makefile
@@ -11,6 +11,12 @@ CC = avr-gcc
 MCU = atmega32u4
 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
 
 # Change if your programmer is different
 AVRDUDE_PROGRAMMER = avrispmkII
@@ -25,7 +31,7 @@ AVRDUDE_FLAGS = -p $(MCU) -P $(AVRDUDE_PORT) -c $(AVRDUDE_PROGRAMMER) -p $(MCU)
 ## Options common to compile, link and assembly rules
 COMMON = -mmcu=$(MCU)
 
-override CFLAGS = -g -Wall -Os -mmcu=$(MCU) -DF_CPU=$(AVR_FREQ) $(DEFS) -ffunction-sections -gdwarf-2 -fdata-sections -fno-split-wide-types
+override CFLAGS = -g -Wall -Os -mmcu=$(MCU) -DF_CPU=$(AVR_FREQ) -DARDUINO_MODEL_PID=$(ARDUINO_MODEL_PID) $(DEFS) -ffunction-sections -gdwarf-2 -fdata-sections -fno-split-wide-types
 
 ## Assembly specific flags
 ASMFLAGS = $(COMMON)
diff --git a/arduino/bootloaders/diskloader/src/Platform.h b/arduino/bootloaders/diskloader/src/Platform.h
index 416d9c3..278b408 100644
--- a/arduino/bootloaders/diskloader/src/Platform.h
+++ b/arduino/bootloaders/diskloader/src/Platform.h
@@ -19,9 +19,9 @@ typedef unsigned long u32;
 #define DISABLE_JTAG()  MCUCR = (1 << JTD) | (1 << IVCE) | (0 << PUD); MCUCR = (1 << JTD) | (0 << IVSEL) | (0 << IVCE) | (0 << PUD);
 
 #define USB_VID 0x2341	// arduino LLC vid
-#define USB_PID 0x0020	// educated guess
+#define USB_PID ARDUINO_MODEL_PID	// passed in by Makefile - 0x0034 for Leonardo, 0x0035 for MIcro
 
-#define FAT_OEM_NAME	'l','e','o','n','a','r','d','o'					// 8 chars
+#define OEM_NAME		'l','e','o','n','a','r','d','o'					// 8 chars
 #define BOARD_INIT()	DDRC |= (1<<7); DDRB |= (1<<0); DDRE |= (1<<6); CPU_PRESCALE(0); DISABLE_JTAG();
 #define LED0			PORTC &= ~(1<<7)
 #define LED1			PORTC |= (1<<7)



[Date Prev][Date Next]   [Thread Prev][Thread Next]   [Thread Index] [Date Index] [Author Index]