sketch USB VID and PID values are passed in from boards.txt at compile time now. changed sketch PIDs to final values. also uncommented Micro section in boards.txt

This commit is contained in:
Zach Eveland 2012-04-09 08:06:35 -04:00
parent d02e4481d3
commit caeaa4571c
6 changed files with 31 additions and 28 deletions

View File

@ -544,6 +544,8 @@ public class Compiler implements MessageConsumer {
"-mmcu=" + boardPreferences.get("build.mcu"), "-mmcu=" + boardPreferences.get("build.mcu"),
"-DF_CPU=" + boardPreferences.get("build.f_cpu"), "-DF_CPU=" + boardPreferences.get("build.f_cpu"),
"-DARDUINO=" + Base.REVISION, "-DARDUINO=" + Base.REVISION,
"-DUSB_VID=" + boardPreferences.get("build.vid"),
"-DUSB_PID=" + boardPreferences.get("build.pid"),
})); }));
for (int i = 0; i < includePaths.size(); i++) { for (int i = 0; i < includePaths.size(); i++) {
@ -571,6 +573,8 @@ public class Compiler implements MessageConsumer {
"-mmcu=" + boardPreferences.get("build.mcu"), "-mmcu=" + boardPreferences.get("build.mcu"),
"-DF_CPU=" + boardPreferences.get("build.f_cpu"), "-DF_CPU=" + boardPreferences.get("build.f_cpu"),
"-MMD", // output dependancy info "-MMD", // output dependancy info
"-DUSB_VID=" + boardPreferences.get("build.vid"),
"-DUSB_PID=" + boardPreferences.get("build.pid"),
"-DARDUINO=" + Base.REVISION, "-DARDUINO=" + Base.REVISION,
})); }));
@ -602,6 +606,8 @@ public class Compiler implements MessageConsumer {
"-mmcu=" + boardPreferences.get("build.mcu"), "-mmcu=" + boardPreferences.get("build.mcu"),
"-DF_CPU=" + boardPreferences.get("build.f_cpu"), "-DF_CPU=" + boardPreferences.get("build.f_cpu"),
"-MMD", // output dependancy info "-MMD", // output dependancy info
"-DUSB_VID=" + boardPreferences.get("build.vid"),
"-DUSB_PID=" + boardPreferences.get("build.pid"),
"-DARDUINO=" + Base.REVISION, "-DARDUINO=" + Base.REVISION,
})); }));

View File

@ -155,31 +155,36 @@ leonardo.bootloader.low_fuses=0xff
leonardo.bootloader.high_fuses=0xd8 leonardo.bootloader.high_fuses=0xd8
leonardo.bootloader.extended_fuses=0xcb leonardo.bootloader.extended_fuses=0xcb
leonardo.bootloader.path=caterina leonardo.bootloader.path=caterina
leonardo.bootloader.file=Caterina.hex leonardo.bootloader.file=Caterina-Leonardo.hex
leonardo.bootloader.unlock_bits=0x3F leonardo.bootloader.unlock_bits=0x3F
leonardo.bootloader.lock_bits=0x2F leonardo.bootloader.lock_bits=0x2F
leonardo.build.mcu=atmega32u4 leonardo.build.mcu=atmega32u4
leonardo.build.f_cpu=16000000L leonardo.build.f_cpu=16000000L
leonardo.build.vid=0x2341
leonardo.build.pid=0x8034
leonardo.build.core=arduino leonardo.build.core=arduino
leonardo.build.variant=leonardo leonardo.build.variant=leonardo
############################################################## ##############################################################
#micro.name=Arduino Micro micro.name=Arduino Micro
#micro.upload.protocol=arduino micro.upload.protocol=avr109
#micro.upload.maximum_size=30720 micro.upload.maximum_size=28672
#micro.upload.speed=1200 micro.upload.speed=57600
#micro.bootloader.low_fuses=0xde micro.upload.disable_flushing=true
#micro.bootloader.high_fuses=0xda micro.bootloader.low_fuses=0xff
#micro.bootloader.extended_fuses=0xcb micro.bootloader.high_fuses=0xd8
#micro.bootloader.path=caterina micro.bootloader.extended_fuses=0xcb
#micro.bootloader.file=Caterina-Micro.hex micro.bootloader.path=caterina
#micro.bootloader.unlock_bits=0x3F micro.bootloader.file=Caterina-Micro.hex
#micro.bootloader.lock_bits=0x2F micro.bootloader.unlock_bits=0x3F
#micro.build.mcu=atmega32u4 micro.bootloader.lock_bits=0x2F
#micro.build.f_cpu=16000000L micro.build.mcu=atmega32u4
#micro.build.core=arduino micro.build.f_cpu=16000000L
#micro.build.variant=micro micro.build.vid=0x2341
micro.build.pid=0x8035
micro.build.core=arduino
micro.build.variant=micro
############################################################## ##############################################################

View File

@ -51,9 +51,9 @@ const u16 STRING_LANGUAGE[2] = {
const u16 STRING_IPRODUCT[17] = { const u16 STRING_IPRODUCT[17] = {
(3<<8) | (2+2*16), (3<<8) | (2+2*16),
#if USB_PID == USB_PID_LEONARDO #if USB_PID == 0x8034
'A','r','d','u','i','n','o',' ','L','e','o','n','a','r','d','o' 'A','r','d','u','i','n','o',' ','L','e','o','n','a','r','d','o'
#elif USB_PID == USB_PID_MICRO #elif USB_PID == 0x8035
'A','r','d','u','i','n','o',' ','M','i','c','r','o',' ',' ',' ' 'A','r','d','u','i','n','o',' ','M','i','c','r','o',' ',' ',' '
#endif #endif
}; };

View File

@ -60,8 +60,4 @@
#define IMANUFACTURER 1 #define IMANUFACTURER 1
#define IPRODUCT 2 #define IPRODUCT 2
#define USB_PID_LEONARDO 0x0801
#define USB_PID_MICRO 0x0035
#define USB_VID 0x2341 // arduino LLC vid
#define USB_PID ARDUINO_MODEL_USB_PID

View File

@ -27,8 +27,6 @@
#include <avr/pgmspace.h> #include <avr/pgmspace.h>
#define ARDUINO_MODEL_USB_PID 0x0801
#define TX_RX_LED_INIT DDRD |= (1<<5), DDRB |= (1<<0) #define TX_RX_LED_INIT DDRD |= (1<<5), DDRB |= (1<<0)
#define TXLED0 PORTD |= (1<<5) #define TXLED0 PORTD |= (1<<5)
#define TXLED1 PORTD &= ~(1<<5) #define TXLED1 PORTD &= ~(1<<5)

View File

@ -23,5 +23,3 @@
*/ */
#include "../leonardo/pins_arduino.h" #include "../leonardo/pins_arduino.h"
#undef ARDUINO_MODEL_USB_PID
#define ARDUINO_MODEL_USB_PID 0x0035