From 5a86391f783353bf96debfa6bf01d66bf82e7caa Mon Sep 17 00:00:00 2001 From: Kevin O'Connor Date: Fri, 5 Jan 2018 10:02:15 -0500 Subject: [PATCH] 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 --- src/avr/Kconfig | 6 ++++++ src/avr/Makefile | 2 +- 2 files changed, 7 insertions(+), 1 deletion(-) 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"