aboutsummaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorSudar <sudar@sudarmuthu.com>2013-06-09 17:18:12 +0530
committerSudar <sudar@sudarmuthu.com>2013-06-09 17:18:12 +0530
commit365118e6a512670a0781d9f32e2290e3b283270a (patch)
tree6e7274d39e377a5aca4bf75ca6d858f6fd5ca0d7
parent2d77e43216347fec0203e07c0e0627bc1914191f (diff)
Enhanced support for programming using Arduino as ISP. Fixes #56
-rw-r--r--HISTORY.md1
-rw-r--r--arduino-mk/Arduino.mk12
2 files changed, 8 insertions, 5 deletions
diff --git a/HISTORY.md b/HISTORY.md
index b78fac5..d84f381 100644
--- a/HISTORY.md
+++ b/HISTORY.md
@@ -8,6 +8,7 @@ The following is the rough list of changes that went into different versions. I
- Allow adding extra common dependencies (COMMON_DEPS) (https://github.com/gaftech)
- Added ifndef ARDUINO_VAR_PATH for compiling for the attiny (https://github.com/danielesteban)
- Strip extra whitespace from the `BOARD_TAG` variable
+- Enhanced support for programming using Arduino as ISP
### 0.10.4 (2013-05-31) @matthijskooijman
- Improved BAUD_RATE detection logic
diff --git a/arduino-mk/Arduino.mk b/arduino-mk/Arduino.mk
index 281f5b8..3bc96e6 100644
--- a/arduino-mk/Arduino.mk
+++ b/arduino-mk/Arduino.mk
@@ -647,6 +647,9 @@ SIZEFLAGS ?= --mcu=$(MCU) -C
# 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!))
+# 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!))
+
# Command for avr_size: do $(call avr_size,elffile,hexfile)
ifneq (,$(findstring AVR,$(shell $(SIZE) --help)))
# We have a patched version of binutils that mentions AVR - pass the MCU
@@ -781,15 +784,14 @@ endif
AVRDUDE_ARD_OPTS = -c $(AVRDUDE_ARD_PROGRAMMER) -b $(AVRDUDE_ARD_BAUDRATE) -P $(call get_arduino_port)
ifndef ISP_PROG
- ISP_PROG = -c stk500v2
+ ISP_PROG = stk500v1
endif
-# usb seems to be a reasonable default, at least on linux
-ifndef ISP_PORT
- ISP_PORT = usb
+ifndef AVRDUDE_ISP_BAUDRATE
+ AVRDUDE_ISP_BAUDRATE = 19200
endif
-AVRDUDE_ISP_OPTS = -P $(ISP_PORT) $(ISP_PROG)
+AVRDUDE_ISP_OPTS = -c $(ISP_PROG) -b $(AVRDUDE_ISP_BAUDRATE) -P $(call get_isp_port)
ifndef ISP_EEPROM
ISP_EEPROM = 0