From 0b8c448b300da233de8b8d4fcdb359ec0679a513 Mon Sep 17 00:00:00 2001 From: Travis La Marr Date: Fri, 15 Jul 2016 10:28:23 -0400 Subject: 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. --- tmk_core/avr.mk | 4 ++++ 1 file changed, 4 insertions(+) (limited to 'tmk_core/avr.mk') 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 -- cgit v1.2.3