aboutsummaryrefslogtreecommitdiffstats
path: root/tmk_core/avr.mk
diff options
context:
space:
mode:
authorGravatar Danny Nguyen <danny@keeb.io>2017-08-16 17:36:34 -0400
committerGravatar Jack Humbert <jack.humb@gmail.com>2017-08-16 20:47:43 -0400
commit71d1c02a9b05c676e98d9e3115e96c01c498a058 (patch)
treec61e218676198453d9f9c729a44490b711989407 /tmk_core/avr.mk
parent4e73b0b8d7750bcddc445b5a52008d4c6cea977d (diff)
downloadqmk_firmware-71d1c02a9b05c676e98d9e3115e96c01c498a058.tar.gz
Add message to avrdude script that it can't used within WSL currently
Diffstat (limited to 'tmk_core/avr.mk')
-rw-r--r--tmk_core/avr.mk28
1 files changed, 16 insertions, 12 deletions
diff --git a/tmk_core/avr.mk b/tmk_core/avr.mk
index 0d0eec3bf..95aa973aa 100644
--- a/tmk_core/avr.mk
+++ b/tmk_core/avr.mk
@@ -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