1
0
Fork 0

Merge pull request #521 from exiva/makefile-wait

Make DFU wait for bootloader
This commit is contained in:
Jack Humbert 2016-07-21 20:57:32 -04:00 committed by GitHub
commit fc4ab870f5

View file

@ -107,6 +107,10 @@ flip: $(BUILD_DIR)/$(TARGET).hex
batchisp -hardware usb -device $(MCU) -operation start reset 0 batchisp -hardware usb -device $(MCU) -operation start reset 0
dfu: $(BUILD_DIR)/$(TARGET).hex sizeafter 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))) ifneq (, $(findstring 0.7, $(shell dfu-programmer --version 2>&1)))
dfu-programmer $(MCU) erase --force dfu-programmer $(MCU) erase --force
else else