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>
This commit is contained in:
Kevin O'Connor 2018-01-05 10:02:15 -05:00
parent 29c83cec22
commit 5a86391f78
2 changed files with 7 additions and 1 deletions

View File

@ -43,6 +43,12 @@ config MCU
default "atmega1280" if MACH_atmega1280 default "atmega1280" if MACH_atmega1280
default "atmega2560" if MACH_atmega2560 default "atmega2560" if MACH_atmega2560
config AVRDUDE_PROTOCOL
string
default "wiring" if MACH_atmega2560
default "avr109" if MACH_at90usb1286
default "arduino"
choice choice
prompt "Processor speed" prompt "Processor speed"
config AVR_FREQ_20000000 config AVR_FREQ_20000000

View File

@ -26,4 +26,4 @@ $(OUT)klipper.elf.hex: $(OUT)klipper.elf
flash: $(OUT)klipper.elf.hex flash: $(OUT)klipper.elf.hex
@echo " Flashing $^ to $(FLASH_DEVICE) via avrdude" @echo " Flashing $^ to $(FLASH_DEVICE) via avrdude"
$(Q)if [ -z $(FLASH_DEVICE) ]; then echo "Please specify FLASH_DEVICE"; exit 1; fi $(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"