]> git.donarmstrong.com Git - qmk_firmware.git/blobdiff - tmk_core/avr.mk
Switch from echo to printf for output without newlines
[qmk_firmware.git] / tmk_core / avr.mk
index 30d4fe26ee46f7c39fa00ccdb096fa5b308c61ba..106b771507a2ee2e3e18528d4ecf9759ba766498 100644 (file)
@@ -136,7 +136,7 @@ flip: $(BUILD_DIR)/$(TARGET).hex check-size
        
 DFU_PROGRAMMER ?= dfu-programmer
 
-dfu: $(BUILD_DIR)/$(TARGET).hex check-size
+dfu: $(BUILD_DIR)/$(TARGET).hex cpfirmware check-size
        until $(DFU_PROGRAMMER) $(MCU) get bootloader-version; do\
                echo "Error: Bootloader not found. Trying again in 5s." ;\
                sleep 5 ;\
@@ -172,13 +172,14 @@ avrdude: $(BUILD_DIR)/$(TARGET).hex check-size
        if grep -q -s Microsoft /proc/version; then \
                echo 'ERROR: AVR flashing cannot be automated within the Windows Subsystem for Linux (WSL) currently. Instead, take the .hex file generated and flash it using AVRDUDE, AVRDUDESS, or XLoader.'; \
        else \
+               printf "Detecting USB port, reset your controller now."; \
                ls /dev/tty* > /tmp/1; \
-               echo -e "Detecting USB port, reset your controller now.\c"; \
                while [ -z $$USB ]; do \
-                       sleep 1; \
-                       echo -e ".\c"; \
+                       sleep 0.5; \
+                       printf "."; \
                        ls /dev/tty* > /tmp/2; \
-                       USB=`diff /tmp/1 /tmp/2 | grep -o '/dev/tty.*'`; \
+                       USB=`comm -13 /tmp/1 /tmp/2 | grep -o '/dev/tty.*'`; \
+                       mv /tmp/2 /tmp/1; \
                done; \
                echo ""; \
                echo "Detected controller on USB port at $$USB"; \