]> git.donarmstrong.com Git - qmk_firmware.git/commitdiff
add 'mavrdude' target into tmk_core/avr.mk (#3986)
authorTakeshi ISHII <2170248+mtei@users.noreply.github.com>
Fri, 28 Sep 2018 02:02:12 +0000 (11:02 +0900)
committerJack Humbert <jack.humb@gmail.com>
Fri, 28 Sep 2018 02:02:12 +0000 (22:02 -0400)
* 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

docs/flashing.md
tmk_core/avr.mk

index e5fe59f8f03948a67e3e010cb75c8309da3c4f79..66c08a361045783c8449cdcff66e46febf7bfa6d 100644 (file)
@@ -78,6 +78,12 @@ or
 
     make <keyboard>:<keymap>:avrdude
 
+or if you want to flash multiple boards, use the following command
+
+    make <keyboard>:<keymap>:avrdude-loop
+
+When you're done flashing boards, you'll need to hit Ctrl + C or whatever the correct keystroke is for your operating system to break the loop.
+
 ## Halfkay
 
 Halfkay is a super-slim protocol developed by PJRC that uses HID, and come on all Teensys (namely the 2.0).
index 2f955b18fe711a0a0ca5d5d8b1d857bab5ba8ef2..add904c9c5217ff345ea0aea751716f7a9c3d2ed 100644 (file)
@@ -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