aboutsummaryrefslogtreecommitdiff
path: root/Arduino.mk
diff options
context:
space:
mode:
authorSimon John <git@the-jedi.co.uk>2019-01-11 19:55:14 +0000
committerGitHub <noreply@github.com>2019-01-11 19:55:14 +0000
commit4452f7790ac5f5302eb11393fb9f2af47f0f5831 (patch)
tree6452ccf06e4514ecbf2af090c4b3153950fadbd1 /Arduino.mk
parentfd24677719fe950c9e233439a40018c4692df138 (diff)
parente3a99fdf4e1484f47f7cb3d9cc0da835804ecf90 (diff)
Merge pull request #597 from tuna-f1sh/master
Fix #594 and sam flag for ardmk-init
Diffstat (limited to 'Arduino.mk')
-rw-r--r--Arduino.mk19
1 files changed, 19 insertions, 0 deletions
diff --git a/Arduino.mk b/Arduino.mk
index a6c2a3c..808c6a9 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
@@ -1161,6 +1177,9 @@ CPPFLAGS += $(OPTIMIZATION_FLAGS)
# USB IDs for the Caterina devices like leonardo or micro
ifneq ($(CATERINA),)
CPPFLAGS += -DUSB_VID=$(USB_VID) -DUSB_PID=$(USB_PID)
+ ifdef USB_PRODUCT
+ CPPFLAGS += -DUSB_PRODUCT='$(USB_PRODUCT)' -DUSB_MANUFACTURER='$(USB_MANUFACTURER)'
+ endif
endif
# $(TOOL_PREFIX)-gcc version that we can do maths on