summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorJack Humbert <jack.humb@gmail.com>2016-07-21 20:57:32 -0400
committerGitHub <noreply@github.com>2016-07-21 20:57:32 -0400
commitfc4ab870f545ec2d8722f1ba7dacd229ef1c033c (patch)
treeebb972c1526a929ac6d216de1ea21083366fc548
parent940358ed4f5cdb9ff6b6a21e2fd9b3f0c35a4347 (diff)
parent0b8c448b300da233de8b8d4fcdb359ec0679a513 (diff)
downloadqmk_firmware-fc4ab870f545ec2d8722f1ba7dacd229ef1c033c.tar.gz
qmk_firmware-fc4ab870f545ec2d8722f1ba7dacd229ef1c033c.zip
Merge pull request #521 from exiva/makefile-wait
Make DFU wait for bootloader
-rw-r--r--tmk_core/avr.mk4
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