Explorar o código

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.
Travis La Marr %!s(int64=9) %!d(string=hai) anos
pai
achega
0b8c448b30
Modificáronse 1 ficheiros con 4 adicións e 0 borrados
  1. 4 0
      tmk_core/avr.mk

+ 4 - 0
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