aboutsummaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorJohn Whittington <git@jbrengineering.co.uk>2019-01-08 17:53:11 +0000
committerJohn Whittington <“git@jbrengineering.co.uk”>2019-01-11 11:17:16 +0000
commit8a313c5d94e4db00c0e0927a1c50737b327b7f6e (patch)
tree2ac2b474c80ae816ad4b0dd253560220da4fe387
parente88f7e1a9fbeb07b7c14700b3e8e50083f4f968a (diff)
Populate USB_PRODUCT and USB_MANUFACTURER if in boards file using Caterina
-rw-r--r--Arduino.mk18
-rw-r--r--HISTORY.md1
2 files changed, 18 insertions, 1 deletions
diff --git a/Arduino.mk b/Arduino.mk
index a6c2a3c..9cfbe75 100644
--- a/Arduino.mk
+++ b/Arduino.mk
@@ -716,6 +716,22 @@ ifeq ($(strip $(NO_CORE)),)
endif
endif
+ ifndef USB_PRODUCT
+ USB_PRODUCT := $(call PARSE_BOARD,$(BOARD_TAG),build.usb_product)
+ ifdef USB_PRODUCT
+ $(call show_config_variable,USB_PRODUCT,[COMPUTED])
+ endif
+ endif
+
+ ifndef USB_MANUFACTURER
+ USB_MANUFACTURER := $(call PARSE_BOARD,$(BOARD_TAG),build.usb_manufacturer)
+ ifndef USB_MANUFACTURER
+ USB_MANUFACTURER = "Unknown"
+ else
+ $(call show_config_variable,USB_MANUFACTURER,[COMPUTED])
+ endif
+ endif
+
# add caterina flag to ARD_RESET_OPTS
ARD_RESET_OPTS += --caterina
endif
@@ -1160,7 +1176,7 @@ CPPFLAGS += $(OPTIMIZATION_FLAGS)
# USB IDs for the Caterina devices like leonardo or micro
ifneq ($(CATERINA),)
- CPPFLAGS += -DUSB_VID=$(USB_VID) -DUSB_PID=$(USB_PID)
+ CPPFLAGS += -DUSB_VID=$(USB_VID) -DUSB_PID=$(USB_PID) '-DUSB_PRODUCT=$(USB_PRODUCT)' '-DUSB_MANUFACTURER=$(USB_MANUFACTURER)'
endif
# $(TOOL_PREFIX)-gcc version that we can do maths on
diff --git a/HISTORY.md b/HISTORY.md
index 2f543f8..dc69258 100644
--- a/HISTORY.md
+++ b/HISTORY.md
@@ -10,6 +10,7 @@ I tried to give credit whenever possible. If I have missed anyone, kindly add it
- Fix: Add -fno-devirtualize flag to workaround g++ segfault bug (issue #486). (https://github.com/sej7278)
- Fix: Quote the prefix tag in the space_pad_to function
- Fix: recognize serial monitors with full path in MONITOR_CMD
+- Fix: Grab USB_PRODUCT and USB_MANUFACTURER from boards.txt for 32u4 boards (issue #594).
- Tweak: Move chip erase flag from set_fuses to ispload to prevent sketch being nuked when setting fuses
- Tweak: Set ARDMK_VERSION to 1.6 (https://github.com/sej7278)
- Tweak: Move non-standard-related items from CxxFLAGS_STD to CxxFLAGS (issue #523) (https://github.com/sej7278)