From 70dfdcc7eb6a4a820533c2c0f58203f4f4ae6da4 Mon Sep 17 00:00:00 2001 From: Chris Patuzzo Date: Sat, 3 May 2014 01:36:42 +0100 Subject: If no port is specified, try to guess it from wildcards Fix #197 --- Arduino.mk | 8 +++++++- 1 file changed, 7 insertions(+), 1 deletion(-) (limited to 'Arduino.mk') diff --git a/Arduino.mk b/Arduino.mk index e31bee7..a352628 100644 --- a/Arduino.mk +++ b/Arduino.mk @@ -866,8 +866,14 @@ ifeq ($(CURRENT_OS), WINDOWS) COM_PORT_ID = $(subst com,,$(MONITOR_PORT)) COM_STYLE_MONITOR_PORT = com$(COM_PORT_ID) DEVICE_PATH = /dev/ttyS$(shell awk 'BEGIN{ print $(COM_PORT_ID) - 1 }') -else +endif + +ifdef ARDUINO_PORT DEVICE_PATH = $(MONITOR_PORT) +else + # If no port is specified, try to guess it from wildcards. + DEVICE_PATH = $(firstword $(wildcard \ + /dev/ttyACM? /dev/ttyUSB? /dev/tty.usbserial* /dev/tty.usbmodem*)) endif # Returns the Arduino port (first wildcard expansion) if it exists, otherwise it errors. -- cgit v1.2.3