aboutsummaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorKevin O'Connor <kevin@koconnor.net>2018-01-05 10:02:15 -0500
committerKevin O'Connor <kevin@koconnor.net>2018-01-05 10:02:15 -0500
commit5a86391f783353bf96debfa6bf01d66bf82e7caa (patch)
tree05dd77faaf624faa6af125ab44e6dbc6107bdd5f
parent29c83cec22190f1a00d118d5743594c8d5eda826 (diff)
downloadkutter-5a86391f783353bf96debfa6bf01d66bf82e7caa.tar.gz
kutter-5a86391f783353bf96debfa6bf01d66bf82e7caa.tar.xz
kutter-5a86391f783353bf96debfa6bf01d66bf82e7caa.zip
avr: Only use the avrdude "wiring" protocol on atmega2560 devices
It appears the most common type of avrdude protocol for devices other than the atmega2560 is the "arduino" protocol. Update the build to select a different protocol based on the avr processor type. Signed-off-by: Kevin O'Connor <kevin@koconnor.net>
-rw-r--r--src/avr/Kconfig6
-rw-r--r--src/avr/Makefile2
2 files changed, 7 insertions, 1 deletions
diff --git a/src/avr/Kconfig b/src/avr/Kconfig
index 77b0f45c..dda36653 100644
--- a/src/avr/Kconfig
+++ b/src/avr/Kconfig
@@ -43,6 +43,12 @@ config MCU
default "atmega1280" if MACH_atmega1280
default "atmega2560" if MACH_atmega2560
+config AVRDUDE_PROTOCOL
+ string
+ default "wiring" if MACH_atmega2560
+ default "avr109" if MACH_at90usb1286
+ default "arduino"
+
choice
prompt "Processor speed"
config AVR_FREQ_20000000
diff --git a/src/avr/Makefile b/src/avr/Makefile
index 651b90ac..371bd961 100644
--- a/src/avr/Makefile
+++ b/src/avr/Makefile
@@ -26,4 +26,4 @@ $(OUT)klipper.elf.hex: $(OUT)klipper.elf
flash: $(OUT)klipper.elf.hex
@echo " Flashing $^ to $(FLASH_DEVICE) via avrdude"
$(Q)if [ -z $(FLASH_DEVICE) ]; then echo "Please specify FLASH_DEVICE"; exit 1; fi
- $(Q)avrdude -p$(CONFIG_MCU) -cwiring -P"$(FLASH_DEVICE)" -D -U"flash:w:$(OUT)klipper.elf.hex:i"
+ $(Q)avrdude -p$(CONFIG_MCU) -c$(CONFIG_AVRDUDE_PROTOCOL) -P"$(FLASH_DEVICE)" -D -U"flash:w:$(OUT)klipper.elf.hex:i"