diff options
author | Travis La Marr <exiva@exiva.net> | 2016-07-15 10:28:23 -0400 |
---|---|---|
committer | Travis La Marr <exiva@exiva.net> | 2016-07-15 10:28:23 -0400 |
commit | 0b8c448b300da233de8b8d4fcdb359ec0679a513 (patch) | |
tree | a0468b2866ddf03d403ff6a015cc2b59cc3c98ff /tmk_core | |
parent | 9ecf9073b96799e52a1f1c0d35b57177382902ce (diff) |
Make DFU wait for bootloader
Added a loop for waiting for the keyboard to be put in bootloader mode,
rather than failing out. Makes building keymaps easier.
Diffstat (limited to 'tmk_core')
-rw-r--r-- | tmk_core/avr.mk | 4 |
1 files changed, 4 insertions, 0 deletions
diff --git a/tmk_core/avr.mk b/tmk_core/avr.mk index 3bf2b34f88..6c03e1650e 100644 --- a/tmk_core/avr.mk +++ b/tmk_core/avr.mk @@ -107,6 +107,10 @@ flip: $(BUILD_DIR)/$(TARGET).hex batchisp -hardware usb -device $(MCU) -operation start reset 0 dfu: $(BUILD_DIR)/$(TARGET).hex sizeafter + until dfu-programmer $(MCU) get bootloader-version; do\ + echo "Error: Bootloader not found. Trying again in 5s." ;\ + sleep 5 ;\ + done ifneq (, $(findstring 0.7, $(shell dfu-programmer --version 2>&1))) dfu-programmer $(MCU) erase --force else |