summaryrefslogtreecommitdiffstats
path: root/tmk_core/avr.mk
diff options
context:
space:
mode:
authorTakeshi ISHII <2170248+mtei@users.noreply.github.com>2018-09-28 11:02:12 +0900
committerJack Humbert <jack.humb@gmail.com>2018-09-27 22:02:12 -0400
commitbaebbc096702c3ecc0ee89b4fbf5749e79f02375 (patch)
treee71f7f0843e959976e2de76a45033c2810cc91a1 /tmk_core/avr.mk
parentedeace279b1cdc5a5450cc5b41d49b341a3a121f (diff)
add 'mavrdude' target into tmk_core/avr.mk (#3986)
* add 'mavrdude' target into tmk_core/avr.mk I made it a little convenient when writing the same binary to multiple Pro Micro. * rename target name 'mavrdude' to 'avrdude-loop' * modify docs/flashing.md about avrdude-loop * mdify docs/flashing.md again * modifi docs/flashing.md 3rd
Diffstat (limited to 'tmk_core/avr.mk')
-rw-r--r--tmk_core/avr.mk12
1 files changed, 11 insertions, 1 deletions
diff --git a/tmk_core/avr.mk b/tmk_core/avr.mk
index 2f955b18fe..add904c9c5 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