aboutsummaryrefslogtreecommitdiff
path: root/arduino-mk
diff options
context:
space:
mode:
authorSudar <sudar@sudarmuthu.com>2013-05-31 17:05:47 +0530
committerSudar <sudar@sudarmuthu.com>2013-05-31 17:10:49 +0530
commit47b2dca1efbee57218d5a3942f8614974136c0ed (patch)
treeafd0a7ded4a2fd1205301f37472748d3c868174c /arduino-mk
parentcd210f96ca9812ea36dfca7c36d58ac0f754ed05 (diff)
Add USB_VID and USB_PID to CPPFLAGS only if the board is Leonardo. Fixes #43 and fixes #51
Diffstat (limited to 'arduino-mk')
-rw-r--r--arduino-mk/Arduino.mk11
1 files changed, 8 insertions, 3 deletions
diff --git a/arduino-mk/Arduino.mk b/arduino-mk/Arduino.mk
index 8d43c9b..e5d9c76 100644
--- a/arduino-mk/Arduino.mk
+++ b/arduino-mk/Arduino.mk
@@ -428,11 +428,11 @@ endif
ifeq ($(VARIANT),leonardo)
# USB IDs for the Leonardo
ifndef USB_VID
-USB_VID = $(shell $(PARSE_BOARD_CMD) $(BOARD_TAG) build.vid)
+USB_VID = $(shell $(PARSE_BOARD_CMD) $(BOARD_TAG) build.vid 2>/dev/null)
endif
ifndef USB_PID
-USB_PID = $(shell $(PARSE_BOARD_CMD) $(BOARD_TAG) build.pid)
+USB_PID = $(shell $(PARSE_BOARD_CMD) $(BOARD_TAG) build.pid 2>/dev/null)
endif
endif
@@ -624,8 +624,13 @@ DEPS = $(LOCAL_OBJS:.o=.d) $(LIB_OBJS:.o=.d) $(USER_LIB_OBJS:.o=.d) $
CPPFLAGS += -mmcu=$(MCU) -DF_CPU=$(F_CPU) -DARDUINO=$(ARDUINO_VERSION) \
-I. -I$(ARDUINO_CORE_PATH) -I$(ARDUINO_VAR_PATH)/$(VARIANT) \
$(SYS_INCLUDES) $(USER_INCLUDES) -g -Os -Wall \
- -DUSB_VID=$(USB_VID) -DUSB_PID=$(USB_PID) \
-ffunction-sections -fdata-sections
+
+# USB IDs for the Leonardo
+ifeq ($(VARIANT),leonardo)
+ CPPFLAGS += -DUSB_VID=$(USB_VID) -DUSB_PID=$(USB_PID)
+endif
+
CFLAGS += -std=gnu99 $(EXTRA_FLAGS) $(EXTRA_CFLAGS)
CXXFLAGS += -fno-exceptions $(EXTRA_FLAGS) $(EXTRA_CXXFLAGS)
ASFLAGS += -mmcu=$(MCU) -I. -x assembler-with-cpp