aboutsummaryrefslogtreecommitdiff
path: root/Arduino.mk
diff options
context:
space:
mode:
authorSudar <sudar@sudarmuthu.com>2014-06-22 10:57:03 +0530
committerSudar <sudar@sudarmuthu.com>2014-06-22 10:57:03 +0530
commit87895de366d1a2ec629672351eff50ba27c84fb8 (patch)
tree4cd14b586443aa83f9729c61b26b077731cf845f /Arduino.mk
parent1b33e8d7416a81ea3200e6218278664101188302 (diff)
parente5b81254690bb82562bac329d5c52a185e4064f4 (diff)
Merge pull request #216 from sej7278/master
Really fix $MONITOR_PORT detection. Fix #215
Diffstat (limited to 'Arduino.mk')
-rw-r--r--Arduino.mk7
1 files changed, 6 insertions, 1 deletions
diff --git a/Arduino.mk b/Arduino.mk
index 3735b08..183f633 100644
--- a/Arduino.mk
+++ b/Arduino.mk
@@ -866,6 +866,7 @@ LDFLAGS += -$(MCU_FLAG_NAME)=$(MCU) -Wl,--gc-sections -O$(OPTIMIZATION_LEV
SIZEFLAGS ?= --mcu=$(MCU) -C
# for backwards compatibility, grab ARDUINO_PORT if the user has it set
+# instead of MONITOR_PORT
MONITOR_PORT ?= $(ARDUINO_PORT)
ifeq ($(CURRENT_OS), WINDOWS)
@@ -879,12 +880,16 @@ ifeq ($(CURRENT_OS), WINDOWS)
DEVICE_PATH = /dev/ttyS$(shell awk 'BEGIN{ print $(COM_PORT_ID) - 1 }')
endif
-ifdef MONITOR_PORT
+ifneq ($(strip $(MONITOR_PORT)),)
+ # set DEVICE_PATH based on user-defined MONITOR_PORT or ARDUINO_PORT
DEVICE_PATH = $(MONITOR_PORT)
+ $(call show_config_variable,DEVICE_PATH,[COMPUTED],(from MONITOR_PORT))
else
# If no port is specified, try to guess it from wildcards.
+ # Will only work if the Arduino is the only/first device matched.
DEVICE_PATH = $(firstword $(wildcard \
/dev/ttyACM? /dev/ttyUSB? /dev/tty.usbserial* /dev/tty.usbmodem*))
+ $(call show_config_variable,DEVICE_PATH,[AUTODETECTED])
endif
# Returns the Arduino port (first wildcard expansion) if it exists, otherwise it errors.