Skip to content

HTTPS clone URL

Subversion checkout URL

You can clone with HTTPS or Subversion.

Download ZIP
Browse files

Added compile condition for Leonardo.

  • Loading branch information...
commit 7fc1489c5ee68b03bfd87c9b599a4e4380a1d115 1 parent 5ee756a
@chungsub authored
Showing with 6 additions and 1 deletion.
  1. +6 −1 arduino-mk/Arduino.mk
View
7 arduino-mk/Arduino.mk
@@ -401,6 +401,7 @@ ifndef F_CPU
F_CPU = $(shell $(PARSE_BOARD_CMD) $(BOARD_TAG) build.f_cpu)
endif
+ifeq ($(VARIANT),leonardo)
# USB IDs for the Leonardo
ifndef USB_VID
USB_VID = $(shell $(PARSE_BOARD_CMD) $(BOARD_TAG) build.vid)
@@ -409,6 +410,7 @@ endif
ifndef USB_PID
USB_PID = $(shell $(PARSE_BOARD_CMD) $(BOARD_TAG) build.pid)
endif
+endif
# normal programming info
ifndef AVRDUDE_ARD_PROGRAMMER
@@ -522,9 +524,12 @@ USER_LIB_OBJS = $(patsubst $(USER_LIB_PATH)/%.cpp,$(OBJDIR)/libs/%.o,$(USER_LIB_
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 -w -Wall \
- -DUSB_VID=$(USB_VID) -DUSB_PID=$(USB_PID) \
-ffunction-sections -fdata-sections
+ifeq ($(VARIANT),leonardo)
+CPPFLAGS += -DUSB_VID=$(USB_VID) -DUSB_PID=$(USB_PID)
+endif
+
CFLAGS = -std=gnu99
CXXFLAGS = -fno-exceptions
ASFLAGS = -mmcu=$(MCU) -I. -x assembler-with-cpp
Please sign in to comment.
Something went wrong with that request. Please try again.