]> git.donarmstrong.com Git - qmk_firmware.git/blobdiff - tmk_core/avr.mk
More thoroughly document Bootmagic and Command (#2455)
[qmk_firmware.git] / tmk_core / avr.mk
index e11ba2e23e79a1a8f52cccf8e862b39b19d9e261..853b8f02f2082b42d62dcd8002e235df0fd36ec5 100644 (file)
@@ -172,17 +172,21 @@ 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 \
-                       echo -e ".\c"; \
                        sleep 0.5; \
+                       printf "."; \
                        ls /dev/tty* > /tmp/2; \
                        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"; \
+               if grep -q -s 'MINGW\|MSYS' /proc/version; then \
+                       USB=`echo "$$USB" | perl -pne 's/\/dev\/ttyS(\d+)/COM.($$1+1)/e'`; \
+                       echo "Remapped MSYS2 USB port to $$USB"; \
+               fi; \
                sleep 1; \
                avrdude -p $(MCU) -c avr109 -P $$USB -U flash:w:$(BUILD_DIR)/$(TARGET).hex; \
        fi