X-Git-Url: https://git.donarmstrong.com/?a=blobdiff_plain;f=tmk_core%2Favr.mk;h=add904c9c5217ff345ea0aea751716f7a9c3d2ed;hb=a054b5a06c00cf148fa416fae8f5a56586a10876;hp=2f955b18fe711a0a0ca5d5d8b1d857bab5ba8ef2;hpb=74f2f855a330899bb078b1a1ba433368e0e05ea6;p=qmk_firmware.git diff --git a/tmk_core/avr.mk b/tmk_core/avr.mk index 2f955b18f..add904c9c 100644 --- a/tmk_core/avr.mk +++ b/tmk_core/avr.mk @@ -169,7 +169,8 @@ dfu-ee: $(BUILD_DIR)/$(TARGET).hex $(BUILD_DIR)/$(TARGET).eep fi $(DFU_PROGRAMMER) $(MCU) reset -avrdude: $(BUILD_DIR)/$(TARGET).hex check-size cpfirmware +define EXEC_AVRDUDE + USB= ;\ if $(GREP) -q -s Microsoft /proc/version; then \ echo 'ERROR: AVR flashing cannot be automated within the Windows Subsystem for Linux (WSL) currently. Instead, take the .hex file generated and flash it using AVRDUDE, AVRDUDESS, or XLoader.'; \ else \ @@ -191,6 +192,15 @@ avrdude: $(BUILD_DIR)/$(TARGET).hex check-size cpfirmware sleep 1; \ avrdude -p $(MCU) -c avr109 -P $$USB -U flash:w:$(BUILD_DIR)/$(TARGET).hex; \ fi +endef + +avrdude: $(BUILD_DIR)/$(TARGET).hex check-size cpfirmware + $(call EXEC_AVRDUDE) + +avrdude-loop: $(BUILD_DIR)/$(TARGET).hex check-size cpfirmware + while true; do \ + $(call EXEC_AVRDUDE) ; \ + done # Convert hex to bin. bin: $(BUILD_DIR)/$(TARGET).hex