Rename ARDUINO_PORT to MONITOR_PORT to reflect support for other platforms.

This commit includes backwards compatibility with the ARDUINO_PORT flag if
that's set.

Fix #109
This commit is contained in:
Christopher Peplin 2013-07-09 19:34:08 -04:00 committed by Sudar
parent 474da2ced4
commit 266d629c25
10 changed files with 21 additions and 18 deletions

View file

@ -86,7 +86,7 @@
# #
# ARDUINO_LIBS = Ethernet SPI # ARDUINO_LIBS = Ethernet SPI
# BOARD_TAG = uno # BOARD_TAG = uno
# ARDUINO_PORT = /dev/cu.usb* # MONITOR_PORT = /dev/cu.usb*
# #
# include /usr/local/share/Arduino.mk # include /usr/local/share/Arduino.mk
# #
@ -96,7 +96,7 @@
# assume these are in $(ARDUINO_DIR)/hardware/libraries # assume these are in $(ARDUINO_DIR)/hardware/libraries
# or your sketchbook's libraries directory) # or your sketchbook's libraries directory)
# #
# ARDUINO_PORT - The port where the Arduino can be found (only needed # MONITOR_PORT - The port where the Arduino can be found (only needed
# when uploading) # when uploading)
# #
# BOARD_TAG - The tag for the board e.g. uno or mega # BOARD_TAG - The tag for the board e.g. uno or mega
@ -566,10 +566,10 @@ endif
ifndef RESET_CMD ifndef RESET_CMD
ifneq ($(CATERINA),) ifneq ($(CATERINA),)
RESET_CMD = $(ARDMK_PATH)/ard-reset-arduino --caterina \ RESET_CMD = $(ARDMK_PATH)/ard-reset-arduino --caterina \
$(ARD_RESET_OPTS) $(call get_arduino_port) $(ARD_RESET_OPTS) $(call get_monitor_port)
else else
RESET_CMD = $(ARDMK_PATH)/ard-reset-arduino \ RESET_CMD = $(ARDMK_PATH)/ard-reset-arduino \
$(ARD_RESET_OPTS) $(call get_arduino_port) $(ARD_RESET_OPTS) $(call get_monitor_port)
endif endif
endif endif
@ -787,8 +787,11 @@ ASFLAGS += -$(MCU_FLAG_NAME)=$(MCU) -I. -x assembler-with-cpp
LDFLAGS += -$(MCU_FLAG_NAME)=$(MCU) -Wl,--gc-sections -O$(OPTIMIZATION_LEVEL) $(EXTRA_FLAGS) $(EXTRA_CXXFLAGS) $(EXTRA_LDFLAGS) LDFLAGS += -$(MCU_FLAG_NAME)=$(MCU) -Wl,--gc-sections -O$(OPTIMIZATION_LEVEL) $(EXTRA_FLAGS) $(EXTRA_CXXFLAGS) $(EXTRA_LDFLAGS)
SIZEFLAGS ?= --mcu=$(MCU) -C SIZEFLAGS ?= --mcu=$(MCU) -C
# for backwards compatibility, grab ARDUINO_PORT if the user has it set
MONITOR_PORT ?= $(ARDUINO_PORT)
# Returns the Arduino port (first wildcard expansion) if it exists, otherwise it errors. # Returns the Arduino port (first wildcard expansion) if it exists, otherwise it errors.
get_arduino_port = $(if $(wildcard $(ARDUINO_PORT)),$(firstword $(wildcard $(ARDUINO_PORT))),$(error Arduino port $(ARDUINO_PORT) not found!)) get_monitor_port = $(if $(wildcard $(MONITOR_PORT)),$(firstword $(wildcard $(MONITOR_PORT))),$(error Arduino port $(MONITOR_PORT) not found!))
# Returns the ISP port (first wildcard expansion) if it exists, otherwise it errors. # 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!)) get_isp_port = $(if $(wildcard $(ISP_PORT)),$(firstword $(wildcard $(ISP_PORT))),$(error ISP port $(ISP_PORT) not found!))
@ -934,7 +937,7 @@ ifdef AVRDUDE_CONF
AVRDUDE_COM_OPTS += -C $(AVRDUDE_CONF) AVRDUDE_COM_OPTS += -C $(AVRDUDE_CONF)
endif endif
AVRDUDE_ARD_OPTS = -c $(AVRDUDE_ARD_PROGRAMMER) -b $(AVRDUDE_ARD_BAUDRATE) -P $(call get_arduino_port) AVRDUDE_ARD_OPTS = -c $(AVRDUDE_ARD_PROGRAMMER) -b $(AVRDUDE_ARD_BAUDRATE) -P $(call get_monitor_port)
ifndef ISP_PROG ifndef ISP_PROG
ISP_PROG = stk500v1 ISP_PROG = stk500v1
@ -1048,9 +1051,9 @@ reset_stty:
for STTYF in 'stty -F' 'stty --file' 'stty -f' 'stty <' ; \ for STTYF in 'stty -F' 'stty --file' 'stty -f' 'stty <' ; \
do $$STTYF /dev/tty >/dev/null 2>&1 && break ; \ do $$STTYF /dev/tty >/dev/null 2>&1 && break ; \
done ; \ done ; \
$$STTYF $(call get_arduino_port) hupcl ; \ $$STTYF $(call get_monitor_port) hupcl ; \
(sleep 0.1 2>/dev/null || sleep 1) ; \ (sleep 0.1 2>/dev/null || sleep 1) ; \
$$STTYF $(call get_arduino_port) -hupcl $$STTYF $(call get_monitor_port) -hupcl
ispload: $(TARGET_EEP) $(TARGET_HEX) verify_size ispload: $(TARGET_EEP) $(TARGET_HEX) verify_size
ifdef AVRDUDE_ISP_FUSES_PRE ifdef AVRDUDE_ISP_FUSES_PRE
@ -1072,7 +1075,7 @@ show_boards:
@cat $(BOARDS_TXT) | grep -E "^[[:alnum:]]" | cut -d . -f 1 | uniq @cat $(BOARDS_TXT) | grep -E "^[[:alnum:]]" | cut -d . -f 1 | uniq
monitor: monitor:
$(MONITOR_CMD) $(call get_arduino_port) $(MONITOR_BAUDRATE) $(MONITOR_CMD) $(call get_monitor_port) $(MONITOR_BAUDRATE)
disasm: $(OBJDIR)/$(TARGET).lss disasm: $(OBJDIR)/$(TARGET).lss
@$(ECHO) The compiled ELF file has been disassembled to $(OBJDIR)/$(TARGET).lss @$(ECHO) The compiled ELF file has been disassembled to $(OBJDIR)/$(TARGET).lss

View file

@ -1,5 +1,5 @@
BOARD_TAG = uno BOARD_TAG = uno
ARDUINO_PORT = /dev/cu.usb* MONITOR_PORT = /dev/cu.usb*
ARDUINO_LIBS = ARDUINO_LIBS =
include ../../arduino-mk/Arduino.mk include ../../arduino-mk/Arduino.mk

View file

@ -1,5 +1,5 @@
BOARD_TAG = uno BOARD_TAG = uno
ARDUINO_PORT = /dev/cu.usb* MONITOR_PORT = /dev/cu.usb*
ARDUINO_LIBS = ARDUINO_LIBS =
include ../../arduino-mk/Arduino.mk include ../../arduino-mk/Arduino.mk

View file

@ -1,5 +1,5 @@
BOARD_TAG = mega_pic32 BOARD_TAG = mega_pic32
ARDUINO_PORT = /dev/cu.usb* MONITOR_PORT = /dev/cu.usb*
ARDUINO_LIBS = ARDUINO_LIBS =
include ../../arduino-mk/chipKIT.mk include ../../arduino-mk/chipKIT.mk

View file

@ -1,5 +1,5 @@
BOARD_TAG = uno BOARD_TAG = uno
ARDUINO_PORT = /dev/cu.usb* MONITOR_PORT = /dev/cu.usb*
ARDUINO_LIBS = ARDUINO_LIBS =
include ../../arduino-mk/Arduino.mk include ../../arduino-mk/Arduino.mk

View file

@ -1,5 +1,5 @@
BOARD_TAG = uno BOARD_TAG = uno
ARDUINO_PORT = /dev/cu.usb* MONITOR_PORT = /dev/cu.usb*
ARDUINO_LIBS = ARDUINO_LIBS =
include ../../arduino-mk/Arduino.mk include ../../arduino-mk/Arduino.mk

View file

@ -1,5 +1,5 @@
BOARD_TAG = uno BOARD_TAG = uno
ARDUINO_PORT = /dev/cu.usb* MONITOR_PORT = /dev/cu.usb*
ARDUINO_LIBS = LiquidCrystal ARDUINO_LIBS = LiquidCrystal
include ../../arduino-mk/Arduino.mk include ../../arduino-mk/Arduino.mk

View file

@ -1,7 +1,7 @@
# Arduino Make file. Refer to https://github.com/sudar/Arduino-Makefile # Arduino Make file. Refer to https://github.com/sudar/Arduino-Makefile
BOARD_TAG = uno BOARD_TAG = uno
ARDUINO_PORT = /dev/cu.usb* MONITOR_PORT = /dev/cu.usb*
ARDUINO_LIBS = Ethernet SPI ARDUINO_LIBS = Ethernet SPI
include ../../arduino-mk/Arduino.mk include ../../arduino-mk/Arduino.mk

View file

@ -1,7 +1,7 @@
# Arduino Make file. Refer to https://github.com/sudar/Arduino-Makefile # Arduino Make file. Refer to https://github.com/sudar/Arduino-Makefile
BOARD_TAG = uno BOARD_TAG = uno
ARDUINO_PORT = /dev/cu.usb* MONITOR_PORT = /dev/cu.usb*
ARDUINO_LIBS = Wire ARDUINO_LIBS = Wire
include ../../arduino-mk/Arduino.mk include ../../arduino-mk/Arduino.mk

View file

@ -1,5 +1,5 @@
BOARD_TAG = uno BOARD_TAG = uno
ARDUINO_PORT = /dev/cu.usb* MONITOR_PORT = /dev/cu.usb*
ARDUINO_LIBS = ARDUINO_LIBS =
include ../../arduino-mk/Arduino.mk include ../../arduino-mk/Arduino.mk