aboutsummaryrefslogtreecommitdiffstats
path: root/tmk_core/avr.mk
diff options
context:
space:
mode:
authorGravatar Danny <nooges@users.noreply.github.com>2018-02-28 16:40:43 -0500
committerGravatar Jack Humbert <jack.humb@gmail.com>2018-02-28 16:40:43 -0500
commit524053e3c0eceab0eadf04cde6c2c0f1a77520fe (patch)
tree63af7911576188cb3700287df04f52ebd570ba81 /tmk_core/avr.mk
parent19b02bf2673e891888cdbf00fc5f7a3776e50505 (diff)
downloadqmk_firmware-524053e3c0eceab0eadf04cde6c2c0f1a77520fe.tar.gz
Remap msys2 usb, fix USB port detection (#2301)
* Add AVRDUDE to MSYS2 setup * Remap detected USB port in MSYS2 to COM port
Diffstat (limited to 'tmk_core/avr.mk')
-rw-r--r--tmk_core/avr.mk4
1 files changed, 4 insertions, 0 deletions
diff --git a/tmk_core/avr.mk b/tmk_core/avr.mk
index 106b77150..853b8f02f 100644
--- a/tmk_core/avr.mk
+++ b/tmk_core/avr.mk
@@ -183,6 +183,10 @@ avrdude: $(BUILD_DIR)/$(TARGET).hex check-size
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