]> git.friedersdorff.com Git - max/tmk_keyboard.git/blobdiff - tmk_core/rules.mk
Merge branch 'quick-start-readme' of https://github.com/EdmundsEcho/tmk_keyboard...
[max/tmk_keyboard.git] / tmk_core / rules.mk
index 0ae84d912fd452b1a9a2000402b487e91569f1c7..ca933826b8c8606fab9fb952572ccc5a54be7f94 100644 (file)
@@ -420,11 +420,14 @@ flip: $(TARGET).hex
        batchisp -hardware usb -device $(MCU) -operation start reset 0
 
 dfu: $(TARGET).hex
-ifneq (, $(findstring 0.7, $(shell dfu-programmer --version 2>&1)))
+       @echo -n dfu-programmer: waiting
+       @until dfu-programmer $(MCU) get bootloader-version > /dev/null 2>&1; do \
+               echo  -n "."; \
+               sleep 1; \
+       done
+       @echo
+
        dfu-programmer $(MCU) erase --force
-else
-       dfu-programmer $(MCU) erase
-endif
        dfu-programmer $(MCU) flash $(TARGET).hex
        dfu-programmer $(MCU) reset
        
@@ -440,11 +443,7 @@ flip-ee: $(TARGET).hex $(TARGET).eep
        $(REMOVE) $(TARGET)eep.hex
 
 dfu-ee: $(TARGET).hex $(TARGET).eep
-ifneq (, $(findstring 0.7, $(shell dfu-programmer --version 2>&1)))
        dfu-programmer $(MCU) flash --eeprom $(TARGET).eep
-else
-       dfu-programmer $(MCU) flash-eeprom $(TARGET).eep
-endif
        dfu-programmer $(MCU) reset