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

This commit is contained in:
Zach Eveland 2011-09-08 09:47:17 -04:00
parent 384f8e80fa
commit cb5b07ae94
3 changed files with 11 additions and 5 deletions

View File

@ -3,8 +3,8 @@
:1078200087020110030000C18081C106C0FF0A0069
:107830000CA10185037508150026FF00954009017C
:107840008102954009029102C0040309041201005B
:10785000020200004041232000000100000101124B
:10786000010002000000404123200000010000014F
:107850000202000040412334000001000001011237
:10786000010002000000404123340000010000013B
:1078700001090264000301008032080B00020202C9
:1078800001000904000001020200000524001001AB
:107890000524010101042402020524060001070554

View File

@ -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)

View File

@ -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)