aboutsummaryrefslogtreecommitdiff
diff options
context:
space:
mode:
-rw-r--r--Arduino.mk27
-rw-r--r--HISTORY.md4
-rw-r--r--README.md5
-rw-r--r--examples/AnalogInOutSerial/Makefile3
-rw-r--r--examples/Blink/Makefile3
-rw-r--r--examples/BlinkChipKIT/Makefile1
-rw-r--r--examples/BlinkInAVRC/Makefile1
-rw-r--r--examples/BlinkWithoutDelay/Makefile3
-rw-r--r--examples/Fade/Makefile3
-rw-r--r--examples/HelloWorld/Makefile1
-rw-r--r--examples/TinySoftWareSerial/Makefile3
-rw-r--r--examples/WebServer/Makefile1
-rw-r--r--examples/master_reader/Makefile1
-rw-r--r--examples/toneMelody/Makefile3
14 files changed, 37 insertions, 22 deletions
diff --git a/Arduino.mk b/Arduino.mk
index c684d2f..68271da 100644
--- a/Arduino.mk
+++ b/Arduino.mk
@@ -571,7 +571,7 @@ endif
# Reset
ifndef RESET_CMD
- ARD_RESET_ARDUINO := $(shell which ard-reset-arduino)
+ ARD_RESET_ARDUINO := $(shell which ard-reset-arduino 2> /dev/null)
ifndef ARD_RESET_ARDUINO
# same level as *.mk in bin directory when checked out from git
# or in $PATH when packaged
@@ -818,8 +818,21 @@ SIZEFLAGS ?= --mcu=$(MCU) -C
# for backwards compatibility, grab ARDUINO_PORT if the user has it set
MONITOR_PORT ?= $(ARDUINO_PORT)
+ifeq ($(CURRENT_OS), WINDOWS)
+ # Expect MONITOR_PORT to be '1' or 'com1' for COM1 in Windows. Split it up
+ # into the two styles required: /dev/ttyS* for ard-reset-arduino and com*
+ # for avrdude. This also could work with /dev/com* device names and be more
+ # consistent, but the /dev/com* is not recommended by Cygwin and doesn't
+ # always show up.
+ 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
+ DEVICE_PATH = $(MONITOR_PORT)
+endif
+
# Returns the Arduino port (first wildcard expansion) if it exists, otherwise it errors.
-get_monitor_port = $(if $(wildcard $(MONITOR_PORT)),$(firstword $(wildcard $(MONITOR_PORT))),$(error Arduino port $(MONITOR_PORT) not found!))
+get_monitor_port = $(if $(wildcard $(DEVICE_PATH)),$(firstword $(wildcard $(DEVICE_PATH))),$(error Arduino port $(DEVICE_PATH) not found!))
# Returns the ISP port (first wildcard expansion) if it exists, otherwise it errors.
get_isp_port = $(if $(wildcard $(ISP_PORT)),$(firstword $(wildcard $(ISP_PORT))),$(error ISP port $(ISP_PORT) not found!))
@@ -995,7 +1008,15 @@ ifdef AVRDUDE_CONF
AVRDUDE_COM_OPTS += -C $(AVRDUDE_CONF)
endif
-AVRDUDE_ARD_OPTS = -c $(AVRDUDE_ARD_PROGRAMMER) -b $(AVRDUDE_ARD_BAUDRATE) -P $(call get_monitor_port)
+AVRDUDE_ARD_OPTS = -c $(AVRDUDE_ARD_PROGRAMMER) -b $(AVRDUDE_ARD_BAUDRATE) -P
+ifeq ($(CURRENT_OS), WINDOWS)
+ # get_monitor_port checks to see if the monitor port exists, assuming it is
+ # a file. In Windows, avrdude needs the port in the format 'com1' which is
+ # not a file, so we have to add the COM-style port directly.
+ AVRDUDE_ARD_OPTS += $(COM_STYLE_MONITOR_PORT)
+else
+ AVRDUDE_ARD_OPTS += $(call get_monitor_port)
+endif
ifndef ISP_PROG
ifneq ($(strip $(AVRDUDE_ARD_PROGRAMMER)),)
diff --git a/HISTORY.md b/HISTORY.md
index 538132d..b7deaeb 100644
--- a/HISTORY.md
+++ b/HISTORY.md
@@ -4,6 +4,10 @@ A Makefile for Arduino Sketches
The following is the rough list of changes that went into different versions.
I tried to give credit whenever possible. If I have missed anyone, kindly add it to the list.
+### 1.3.0 (2014-01-29)
+- Fix: Use more reliable serial device naming in Windows. Fix issue #139 and #155 (https://github.com/peplin)
+- Fix: Document that ARDUINO_DIR must be a relative path in Windows. Fix issue #156 (https://github.com/peplin)
+
### 1.2.0 (2014-01-14)
- Add: Add RPM SPECfile and new `package` directory to store package instructions and files (https://github.com/sej7278)
- Fix: Remove use of arduino-mk subdirectory in git. Fix issue #151, #152 and #147 (https://github.com/sej7278)
diff --git a/README.md b/README.md
index 5dd9e39..7176049 100644
--- a/README.md
+++ b/README.md
@@ -22,8 +22,9 @@ On Linux, you shouldn't need to set anything other than your board type and port
MONITOR_PORT = /dev/ttyACM0
- `BOARD_TAG` - Type of board, for a list see boards.txt or `make show_boards`
-- `MONITOR_PORT` - The port where your Arduino is plugged in, usually `/dev/ttyACM0` or `/dev/ttyUSB0`
-- `ARDUINO_DIR` - Path to Arduino installation
+- `MONITOR_PORT` - The port where your Arduino is plugged in, usually `/dev/ttyACM0` or `/dev/ttyUSB0` in Linux or Mac OS X and `com3`, `com4`, etc. in Windows.
+- `ARDUINO_DIR` - Path to Arduino installation. In Cygwin in Windows this path must be
+ relative, not absolute (e.g. "../../arduino" and not "/c/cygwin/Arduino").
- `ARDMK_DIR` - Path where the `*.mk` are present. If you installed the package, then it is usually `/usr/share/arduino`
- `AVR_TOOLS_DIR` - Path where the avr tools chain binaries are present. If you are going to use the binaries that came with Arduino installation, then you don't have to set it.
diff --git a/examples/AnalogInOutSerial/Makefile b/examples/AnalogInOutSerial/Makefile
index 0e3d886..3dea6c0 100644
--- a/examples/AnalogInOutSerial/Makefile
+++ b/examples/AnalogInOutSerial/Makefile
@@ -1,5 +1,4 @@
BOARD_TAG = uno
-MONITOR_PORT = /dev/cu.usb*
-ARDUINO_LIBS =
+ARDUINO_LIBS =
include ../../Arduino.mk
diff --git a/examples/Blink/Makefile b/examples/Blink/Makefile
index e202b14..7678e9b 100644
--- a/examples/Blink/Makefile
+++ b/examples/Blink/Makefile
@@ -1,6 +1,5 @@
BOARD_TAG = uno
-MONITOR_PORT = /dev/cu.usb*
-ARDUINO_LIBS =
+ARDUINO_LIBS =
include ../../Arduino.mk
diff --git a/examples/BlinkChipKIT/Makefile b/examples/BlinkChipKIT/Makefile
index 1c1d7e5..87a9f7d 100644
--- a/examples/BlinkChipKIT/Makefile
+++ b/examples/BlinkChipKIT/Makefile
@@ -1,5 +1,4 @@
BOARD_TAG = mega_pic32
-MONITOR_PORT = /dev/cu.usb*
ARDUINO_LIBS =
include ../../chipKIT.mk
diff --git a/examples/BlinkInAVRC/Makefile b/examples/BlinkInAVRC/Makefile
index dcf21d9..04049bb 100644
--- a/examples/BlinkInAVRC/Makefile
+++ b/examples/BlinkInAVRC/Makefile
@@ -10,7 +10,6 @@ F_CPU = 8000000L
ISP_PROG = stk500v1
AVRDUDE_ISP_BAUDRATE = 19200
-ISP_PORT = /dev/ttyACM*
include $(ARDMK_DIR)/Arduino.mk
diff --git a/examples/BlinkWithoutDelay/Makefile b/examples/BlinkWithoutDelay/Makefile
index 0e3d886..3dea6c0 100644
--- a/examples/BlinkWithoutDelay/Makefile
+++ b/examples/BlinkWithoutDelay/Makefile
@@ -1,5 +1,4 @@
BOARD_TAG = uno
-MONITOR_PORT = /dev/cu.usb*
-ARDUINO_LIBS =
+ARDUINO_LIBS =
include ../../Arduino.mk
diff --git a/examples/Fade/Makefile b/examples/Fade/Makefile
index 0e3d886..3dea6c0 100644
--- a/examples/Fade/Makefile
+++ b/examples/Fade/Makefile
@@ -1,5 +1,4 @@
BOARD_TAG = uno
-MONITOR_PORT = /dev/cu.usb*
-ARDUINO_LIBS =
+ARDUINO_LIBS =
include ../../Arduino.mk
diff --git a/examples/HelloWorld/Makefile b/examples/HelloWorld/Makefile
index bd804be..fb94fdd 100644
--- a/examples/HelloWorld/Makefile
+++ b/examples/HelloWorld/Makefile
@@ -1,5 +1,4 @@
BOARD_TAG = uno
-MONITOR_PORT = /dev/cu.usb*
ARDUINO_LIBS = LiquidCrystal
include ../../Arduino.mk
diff --git a/examples/TinySoftWareSerial/Makefile b/examples/TinySoftWareSerial/Makefile
index 8c220db..08f918d 100644
--- a/examples/TinySoftWareSerial/Makefile
+++ b/examples/TinySoftWareSerial/Makefile
@@ -1,12 +1,11 @@
# Arduino Make file. Refer to https://github.com/sudar/Arduino-Makefile
-# if you have placed the alternate core in your sketchbook directory, then you can just mention the core name alone.
+# if you have placed the alternate core in your sketchbook directory, then you can just mention the core name alone.
ALTERNATE_CORE = attiny
# If not, you might have to include the full path.
#ALTERNATE_CORE_PATH = /home/sudar/Dropbox/code/arduino-sketches/hardware/attiny/
BOARD_TAG = attiny85-8
-ISP_PORT = /dev/ttyACM*
ARDUINO_LIBS = SoftwareSerial
diff --git a/examples/WebServer/Makefile b/examples/WebServer/Makefile
index 547c6fa..51b9ac2 100644
--- a/examples/WebServer/Makefile
+++ b/examples/WebServer/Makefile
@@ -1,7 +1,6 @@
# Arduino Make file. Refer to https://github.com/sudar/Arduino-Makefile
BOARD_TAG = uno
-MONITOR_PORT = /dev/cu.usb*
ARDUINO_LIBS = Ethernet SPI
include ../../Arduino.mk
diff --git a/examples/master_reader/Makefile b/examples/master_reader/Makefile
index 38b7f82..3030deb 100644
--- a/examples/master_reader/Makefile
+++ b/examples/master_reader/Makefile
@@ -1,7 +1,6 @@
# Arduino Make file. Refer to https://github.com/sudar/Arduino-Makefile
BOARD_TAG = uno
-MONITOR_PORT = /dev/cu.usb*
ARDUINO_LIBS = Wire
include ../../Arduino.mk
diff --git a/examples/toneMelody/Makefile b/examples/toneMelody/Makefile
index 0e3d886..3dea6c0 100644
--- a/examples/toneMelody/Makefile
+++ b/examples/toneMelody/Makefile
@@ -1,5 +1,4 @@
BOARD_TAG = uno
-MONITOR_PORT = /dev/cu.usb*
-ARDUINO_LIBS =
+ARDUINO_LIBS =
include ../../Arduino.mk