]> git.donarmstrong.com Git - qmk_firmware.git/commitdiff
Add message to avrdude script that it can't used within WSL currently
authorDanny Nguyen <danny@keeb.io>
Wed, 16 Aug 2017 21:36:34 +0000 (17:36 -0400)
committerJack Humbert <jack.humb@gmail.com>
Thu, 17 Aug 2017 00:47:43 +0000 (20:47 -0400)
tmk_core/avr.mk

index 0d0eec3bf34e85d557ee2a90931ce8af2568ea80..95aa973aa916845333c1ba34983e9e59085979ad 100644 (file)
@@ -145,18 +145,22 @@ dfu-ee: $(BUILD_DIR)/$(TARGET).hex $(BUILD_DIR)/$(TARGET).eep
        $(DFU_PROGRAMMER) $(MCU) reset
 
 avrdude: $(BUILD_DIR)/$(TARGET).hex
-       ls /dev/tty* > /tmp/1; \
-       echo "Detecting Pro Micro port, reset your Pro Micro now.\c"; \
-       while [ -z $$USB ]; do \
-         sleep 1; \
-         echo ".\c"; \
-         ls /dev/tty* > /tmp/2; \
-         USB=`diff /tmp/1 /tmp/2 | grep -o '/dev/tty.*'`; \
-       done; \
-       echo ""; \
-       echo "Detected Pro Micro port at $$USB"; \
-       sleep 1; \
-       avrdude -p $(MCU) -c avr109 -P $$USB -U flash:w:$(BUILD_DIR)/$(TARGET).hex
+       if grep -q -s Microsoft /proc/version; then \
+               echo 'ERROR: Pro Micros can not be flashed within the Windows Subsystem for Linux (WSL) currently. Instead, take the .hex file generated and flash it using AVRDUDE, AVRDUDESS, or XLoader.'; \
+       else \
+               ls /dev/tty* > /tmp/1; \
+               echo "Detecting Pro Micro port, reset your Pro Micro now.\c"; \
+               while [ -z $$USB ]; do \
+                       sleep 1; \
+                       echo ".\c"; \
+                       ls /dev/tty* > /tmp/2; \
+                       USB=`diff /tmp/1 /tmp/2 | grep -o '/dev/tty.*'`; \
+               done; \
+               echo ""; \
+               echo "Detected Pro Micro port at $$USB"; \
+               sleep 1; \
+               avrdude -p $(MCU) -c avr109 -P $$USB -U flash:w:$(BUILD_DIR)/$(TARGET).hex; \
+       fi
 
 # Convert hex to bin.
 flashbin: $(BUILD_DIR)/$(TARGET).hex