diff options
| author | Takeshi ISHII <2170248+mtei@users.noreply.github.com> | 2018-09-28 11:02:12 +0900 |
|---|---|---|
| committer | Jack Humbert <jack.humb@gmail.com> | 2018-09-27 22:02:12 -0400 |
| commit | baebbc096702c3ecc0ee89b4fbf5749e79f02375 (patch) | |
| tree | e71f7f0843e959976e2de76a45033c2810cc91a1 | |
| parent | edeace279b1cdc5a5450cc5b41d49b341a3a121f (diff) | |
| download | qmk_firmware-baebbc096702c3ecc0ee89b4fbf5749e79f02375.tar.gz qmk_firmware-baebbc096702c3ecc0ee89b4fbf5749e79f02375.zip | |
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
| -rw-r--r-- | docs/flashing.md | 6 | ||||
| -rw-r--r-- | tmk_core/avr.mk | 12 |
2 files changed, 17 insertions, 1 deletions
diff --git a/docs/flashing.md b/docs/flashing.md index e5fe59f8f..66c08a361 100644 --- a/docs/flashing.md +++ b/docs/flashing.md | |||
| @@ -78,6 +78,12 @@ or | |||
| 78 | 78 | ||
| 79 | make <keyboard>:<keymap>:avrdude | 79 | make <keyboard>:<keymap>:avrdude |
| 80 | 80 | ||
| 81 | or if you want to flash multiple boards, use the following command | ||
| 82 | |||
| 83 | make <keyboard>:<keymap>:avrdude-loop | ||
| 84 | |||
| 85 | 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. | ||
| 86 | |||
| 81 | ## Halfkay | 87 | ## Halfkay |
| 82 | 88 | ||
| 83 | Halfkay is a super-slim protocol developed by PJRC that uses HID, and come on all Teensys (namely the 2.0). | 89 | Halfkay is a super-slim protocol developed by PJRC that uses HID, and come on all Teensys (namely the 2.0). |
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 | |||
| 169 | fi | 169 | fi |
| 170 | $(DFU_PROGRAMMER) $(MCU) reset | 170 | $(DFU_PROGRAMMER) $(MCU) reset |
| 171 | 171 | ||
| 172 | avrdude: $(BUILD_DIR)/$(TARGET).hex check-size cpfirmware | 172 | define EXEC_AVRDUDE |
| 173 | USB= ;\ | ||
| 173 | if $(GREP) -q -s Microsoft /proc/version; then \ | 174 | if $(GREP) -q -s Microsoft /proc/version; then \ |
| 174 | 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.'; \ | 175 | 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.'; \ |
| 175 | else \ | 176 | else \ |
| @@ -191,6 +192,15 @@ avrdude: $(BUILD_DIR)/$(TARGET).hex check-size cpfirmware | |||
| 191 | sleep 1; \ | 192 | sleep 1; \ |
| 192 | avrdude -p $(MCU) -c avr109 -P $$USB -U flash:w:$(BUILD_DIR)/$(TARGET).hex; \ | 193 | avrdude -p $(MCU) -c avr109 -P $$USB -U flash:w:$(BUILD_DIR)/$(TARGET).hex; \ |
| 193 | fi | 194 | fi |
| 195 | endef | ||
| 196 | |||
| 197 | avrdude: $(BUILD_DIR)/$(TARGET).hex check-size cpfirmware | ||
| 198 | $(call EXEC_AVRDUDE) | ||
| 199 | |||
| 200 | avrdude-loop: $(BUILD_DIR)/$(TARGET).hex check-size cpfirmware | ||
| 201 | while true; do \ | ||
| 202 | $(call EXEC_AVRDUDE) ; \ | ||
| 203 | done | ||
| 194 | 204 | ||
| 195 | # Convert hex to bin. | 205 | # Convert hex to bin. |
| 196 | bin: $(BUILD_DIR)/$(TARGET).hex | 206 | bin: $(BUILD_DIR)/$(TARGET).hex |
