Added support for PuTTY on Windows

Use MONITOR_CMD=putty
The optional parameter MONITOR_PARMS can be used as well
This commit is contained in:
Peter Mosmans 2014-11-18 11:01:39 +11:00
parent 6053817833
commit 421db6e89e
2 changed files with 19 additions and 2 deletions

View file

@ -1015,7 +1015,11 @@ else
endif endif
# 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_monitor_port = $(if $(wildcard $(DEVICE_PATH)),$(firstword $(wildcard $(DEVICE_PATH))),$(error Arduino port $(DEVICE_PATH) not found!)) ifeq ($(CURRENT_OS), WINDOWS)
get_monitor_port = $(DEVICE_PATH)
else
get_monitor_port = $(if $(wildcard $(DEVICE_PATH)),$(firstword $(wildcard $(DEVICE_PATH))),$(error Arduino port $(DEVICE_PATH) not found!))
endif
# 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))),$(if $(findstring Xusb,X$(ISP_PORT)),$(ISP_PORT),$(error ISP port $(ISP_PORT) not found!))) get_isp_port = $(if $(wildcard $(ISP_PORT)),$(firstword $(wildcard $(ISP_PORT))),$(if $(findstring Xusb,X$(ISP_PORT)),$(ISP_PORT),$(error ISP port $(ISP_PORT) not found!)))
@ -1407,7 +1411,15 @@ show_boards:
@$(CAT) "$(BOARDS_TXT)" | grep -E "^[a-zA-Z0-9_]+.name" | sort -uf | sed 's/.name=/:/' | column -s: -t @$(CAT) "$(BOARDS_TXT)" | grep -E "^[a-zA-Z0-9_]+.name" | sort -uf | sed 's/.name=/:/' | column -s: -t
monitor: monitor:
ifneq ("$(MONITOR_CMD)", "putty")
$(MONITOR_CMD) $(call get_monitor_port) $(MONITOR_BAUDRATE) $(MONITOR_CMD) $(call get_monitor_port) $(MONITOR_BAUDRATE)
else
ifneq ($(strip $(MONITOR_PARMS)),)
$(MONITOR_CMD) -serial -sercfg $(MONITOR_BAUDRATE),$(MONITOR_PARMS) $(call get_monitor_port)
else
$(MONITOR_CMD) -serial -sercfg $(MONITOR_BAUDRATE) $(call get_monitor_port)
endif
endif
disasm: $(OBJDIR)/$(TARGET).lss disasm: $(OBJDIR)/$(TARGET).lss
@$(ECHO) "The compiled ELF file has been disassembled to $(OBJDIR)/$(TARGET).lss\n\n" @$(ECHO) "The compiled ELF file has been disassembled to $(OBJDIR)/$(TARGET).lss\n\n"

View file

@ -102,6 +102,11 @@ On Windows (using cygwin), you might want to set:
MONITOR_PORT = com3 MONITOR_PORT = com3
BOARD_TAG = mega2560 BOARD_TAG = mega2560
On Windows (using MSYS and PuTTY), you might want to set the following extra parameters:
MONITOR_CMD = putty
MONITOR_PARMS = 8,1,n,N
On Arduino 1.5.x installs, you should set the architecture to either `avr` or `sam` and if using a submenu CPU, then also set that: On Arduino 1.5.x installs, you should set the architecture to either `avr` or `sam` and if using a submenu CPU, then also set that:
ARCHITECTURE = avr ARCHITECTURE = avr