Skip to content

Commit d136359

Browse files
committed
Fix autodetection of USB_PID on SparkFun's new ProMicro core
Remove use of tilde in documentation as ~ doesn't work, use $(HOME) instead
1 parent 807cf65 commit d136359

File tree

3 files changed

+25
-19
lines changed

3 files changed

+25
-19
lines changed

Arduino.mk

Lines changed: 5 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -628,8 +628,12 @@ ifeq ($(strip $(NO_CORE)),)
628628
USB_VID = $(call PARSE_BOARD,$(BOARD_TAG),build.vid)
629629
endif
630630

631+
# coping with 2-3 methods sparkfun use for usb.pid
631632
ifndef USB_PID
632-
USB_PID = $(call PARSE_BOARD,$(BOARD_TAG),build.pid)
633+
USB_PID := $(call PARSE_BOARD,$(BOARD_TAG),build.pid)
634+
ifndef USB_PID
635+
USB_PID := $(call PARSE_BOARD,$(BOARD_TAG),menu.(chip|cpu).$(BOARD_SUB).build.pid)
636+
endif
633637
endif
634638
endif
635639

HISTORY.md

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -5,11 +5,13 @@ The following is the rough list of changes that went into different versions.
55
I tried to give credit whenever possible. If I have missed anyone, kindly add it to the list.
66

77
### In Development
8+
- Fix: Allowed for SparkFun's weird usb pid/vid submenu shenanigans (issue #499). (https://github.com/sej7278)
89
- Fix: Do not include the Arduino header when calling generate_assembly on .cpp files. (https://github.com/Batchyx)
910
- Fix: Auto-detect F_CPU on Teensy from boards.txt (https://github.com/DaWelter)
1011
- Fix: params typo in PuTTY section (issue #487) (https://github.com/ericdand)
1112
- Fix: Fixed sed expression to properly format show_submenu (issue #488) (https://github.com/cbosdo)
1213
- New: Add support for good old cu as monitor command (issue #492) (https://github.com/mwm)
14+
- Tweak: Removed tilde from documentation (issue #497). (https://github.com/sej7278)
1315

1416
### 1.5.2 (2017-01-11)
1517

arduino-mk-vars.md

Lines changed: 18 additions & 18 deletions
Original file line numberDiff line numberDiff line change
@@ -83,7 +83,7 @@ Defaults to `ard-reset-arduino` with the extra `--caterina` flag for atmega32u4
8383
**Example:**
8484

8585
```Makefile
86-
RESET_CMD = ~/gertduino/reset
86+
RESET_CMD = $(HOME)/gertduino/reset
8787
```
8888

8989
**Requirement:** *Optional*
@@ -190,12 +190,12 @@ ARDMK_VENDOR = sparkfun
190190

191191
Path to `sketchbook` directory.
192192

193-
Usually can be auto-detected from the Arduino `preferences.txt` file or the default `~/sketchbook`
193+
Usually can be auto-detected from the Arduino `preferences.txt` file or the default `$(HOME)/sketchbook`
194194

195195
**Example:**
196196

197197
```Makefile
198-
ARDUINO_SKETCHBOOK = ~/sketches
198+
ARDUINO_SKETCHBOOK = $(HOME)/sketches
199199
```
200200

201201
**Requirement:** *Optional*
@@ -210,15 +210,15 @@ Path to Arduino `preferences.txt` file.
210210

211211
Usually can be auto-detected as `AUTO_ARDUINO_PREFERENCES` from the defaults:
212212

213-
* on Linux (1.0): `~/.arduino/preferences.txt`
214-
* on Linux (1.5+): `~/.arduino15/preferences.txt`
215-
* on Mac OS X (1.0): `~/Library/Arduino/preferences.txt`
216-
* on Mac OS X (1.5+): `~/Library/Arduino15/preferences.txt`
213+
* on Linux (1.0): `$(HOME)/.arduino/preferences.txt`
214+
* on Linux (1.5+): `$(HOME)/.arduino15/preferences.txt`
215+
* on Mac OS X (1.0): `$(HOME)/Library/Arduino/preferences.txt`
216+
* on Mac OS X (1.5+): `$(HOME)/Library/Arduino15/preferences.txt`
217217

218218
**Example:**
219219

220220
```Makefile
221-
ARDUINO_PREFERENCES_PATH = ~/sketches/preferences.txt
221+
ARDUINO_PREFERENCES_PATH = $(HOME)/sketches/preferences.txt
222222
```
223223

224224
**Requirement:** *Optional*
@@ -351,7 +351,7 @@ Defaults to `libraries` directory within user's sketchbook.
351351

352352
```Makefile
353353
# Linux
354-
USER_LIB_PATH = ~/sketchbook/libraries
354+
USER_LIB_PATH = $(HOME)/sketchbook/libraries
355355
# For a random project on *nix
356356
USER_LIB_PATH = /path/to/my/project
357357
```
@@ -428,7 +428,7 @@ Path to non-standard core's variant files.
428428
**Example:**
429429

430430
```Makefile
431-
ARDUINO_VAR_PATH = ~/sketchbook/hardware/arduino-tiny/cores/tiny
431+
ARDUINO_VAR_PATH = $(HOME)/sketchbook/hardware/arduino-tiny/cores/tiny
432432
```
433433

434434
**Requirement:** *Optional*
@@ -1104,7 +1104,7 @@ Defaults to `pre-build-hook.sh`
11041104
**Example:**
11051105

11061106
```Makefile
1107-
PRE_BUILD_HOOK = ~/bin/bump-revision.sh
1107+
PRE_BUILD_HOOK = $(HOME)/bin/bump-revision.sh
11081108
```
11091109

11101110
**Requirement:** *Optional*
@@ -1219,7 +1219,7 @@ Defaults to `ARDUINO_SKETCHBOOK/hardware/ALTERNATE_CORE`
12191219
**Example:**
12201220

12211221
```Makefile
1222-
ALTERNATE_CORE_PATH = ~/sketchbook/hardware/arduino-tiny/cores/tiny
1222+
ALTERNATE_CORE_PATH = $(HOME)/sketchbook/hardware/arduino-tiny/cores/tiny
12231223
```
12241224

12251225
**Requirement:** *Optional*
@@ -1237,7 +1237,7 @@ Defaults to `ARDUINO_DIR/hardware/arduino/boards.txt`
12371237
**Example:**
12381238

12391239
```Makefile
1240-
BOARD_TXT = ~/sketchbook/hardware/boards.txt
1240+
BOARD_TXT = $(HOME)/sketchbook/hardware/boards.txt
12411241
# or
12421242
BOARD_TXT = /usr/share/arduino/hardware/arduino/boards.txt
12431243
```
@@ -1371,12 +1371,12 @@ Defaults to `/usr/share/arduino/hardware/arduino/bootloaders` (Linux)
13711371
**Example:**
13721372

13731373
```Makefile
1374-
BOOTLOADER_PARENT = ~/sketchbook/hardware/promicro/bootloaders
1374+
BOOTLOADER_PARENT = $(HOME)/sketchbook/hardware/promicro/bootloaders
13751375
BOOTLOADER_PATH = caterina
13761376
BOOTLOADER_FILE = Caterina-promicro16.hex
13771377
```
13781378

1379-
Would result in an absolute path to the bootloader hex file of `~/sketchbook/hardware/promicro/bootloaders/caterina/Caterina-promicro16.hex`
1379+
Would result in an absolute path to the bootloader hex file of `$(HOME)/sketchbook/hardware/promicro/bootloaders/caterina/Caterina-promicro16.hex`
13801380

13811381
**Requirement:** *Optional, unless BOOTLOADER_FILE and/or BOOTLOADER_PATH are user-defined*
13821382

@@ -1395,7 +1395,7 @@ Usually can be auto-detected as `AUTO_MPIDE_DIR` from the defaults `/usr/share/m
13951395
**Example:**
13961396

13971397
```Makefile
1398-
MPIDE_DIR = ~/mpide
1398+
MPIDE_DIR = $(HOME)/mpide
13991399
```
14001400

14011401
**Requirement:** *Optional*
@@ -1408,12 +1408,12 @@ MPIDE_DIR = ~/mpide
14081408

14091409
Path to chipKIT `preferences.txt` file.
14101410

1411-
Usually can be auto-detected as `AUTO_MPIDE_PREFERENCES_PATH` from the defaults `~/.mpide/preferences.txt` (Linux) or `~/Library/Mpide/preferences.txt` (OSX)
1411+
Usually can be auto-detected as `AUTO_MPIDE_PREFERENCES_PATH` from the defaults `$(HOME)/.mpide/preferences.txt` (Linux) or `$(HOME)/Library/Mpide/preferences.txt` (OSX)
14121412

14131413
**Example:**
14141414

14151415
```Makefile
1416-
MPIDE_PREFERENCES_PATH = ~/chipkit/preferences.txt
1416+
MPIDE_PREFERENCES_PATH = $(HOME)/chipkit/preferences.txt
14171417
```
14181418

14191419
**Requirement:** *Optional*

0 commit comments

Comments
 (0)