Skip to content

Commit 63ec4ab

Browse files
committed
added compile-time definition of sketch PID. PID is pulled from variants/leonardo or the new variants/micro as appropriate.
1 parent d2749dc commit 63ec4ab

File tree

3 files changed

+30
-12
lines changed

3 files changed

+30
-12
lines changed

cores/arduino/USBDesc.h

+1-12
Original file line numberDiff line numberDiff line change
@@ -89,19 +89,8 @@
8989
#define FAT_FILE_NAME 'F','I','R','M','W','A','R','E','B','I','N' // 11 chars
9090
#define MSC_DISK_SERIAL '0','0','0','0','0','0','0','0','1','7','0','1' // 12 chars
9191

92-
#ifdef MICROTOUCH
93-
94-
#define USB_VID 0x239A // Adafruit vid
95-
#define USB_PID 0x2001 // sorry dave sprach zarathustra
96-
#define FAT_OEM_NAME 'r','o','s','s','u','m','u','r' // 8 chars
97-
#define PRODUCT_NAME 'M','i','c','r','o','t','o','u','c','h'
98-
99-
#else
100-
10192
#define USB_VID 0x2341 // arduino LLC vid
102-
#define USB_PID 0x0020 // educated guess
93+
#define USB_PID ARDUINO_MODEL_USB_PID
10394
#define FAT_OEM_NAME 'l','e','o','n','a','r','d','o' // 8 chars
10495
#define PRODUCT_NAME 'A','r','d','u','i','n','o','l','l','c' // 10
10596

106-
107-
#endif

variants/leonardo/pins_arduino.h

+2
Original file line numberDiff line numberDiff line change
@@ -27,6 +27,8 @@
2727

2828
#include <avr/pgmspace.h>
2929

30+
#define ARDUINO_MODEL_USB_PID 0x0034
31+
3032
// Map SPI port to 'new' pins D14..D17
3133
// D14 PB0 RXLED,SS/PCINT0
3234
// D15 PB1 SCK,PCINT1

variants/micro/pins_arduino.h

+27
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,27 @@
1+
/*
2+
pins_arduino.h - Pin definition functions for Arduino
3+
Part of Arduino - http://www.arduino.cc/
4+
5+
Copyright (c) 2007 David A. Mellis
6+
7+
This library is free software; you can redistribute it and/or
8+
modify it under the terms of the GNU Lesser General Public
9+
License as published by the Free Software Foundation; either
10+
version 2.1 of the License, or (at your option) any later version.
11+
12+
This library is distributed in the hope that it will be useful,
13+
but WITHOUT ANY WARRANTY; without even the implied warranty of
14+
MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
15+
Lesser General Public License for more details.
16+
17+
You should have received a copy of the GNU Lesser General
18+
Public License along with this library; if not, write to the
19+
Free Software Foundation, Inc., 59 Temple Place, Suite 330,
20+
Boston, MA 02111-1307 USA
21+
22+
$Id: wiring.h 249 2007-02-03 16:52:51Z mellis $
23+
*/
24+
25+
#include "../leonardo/pins_arduino.h"
26+
#undef ARDUINO_MODEL_USB_PID
27+
#define ARDUINO_MODEL_USB_PID 0x0035

0 commit comments

Comments
 (0)