Skip to content

Commit

Permalink
Browse files Browse the repository at this point in the history
Remap msys2 usb, fix USB port detection (#2301)
* Add AVRDUDE to MSYS2 setup

* Remap detected USB port in MSYS2 to COM port
  • Loading branch information
nooges authored and jackhumbert committed Feb 28, 2018
1 parent 19b02bf commit 524053e
Show file tree
Hide file tree
Showing 2 changed files with 5 additions and 0 deletions.
4 changes: 4 additions & 0 deletions tmk_core/avr.mk
Expand Up @@ -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
Expand Down
1 change: 1 addition & 0 deletions util/msys2_install.sh
Expand Up @@ -16,6 +16,7 @@ function install_avr {
wget "http://ww1.microchip.com/downloads/en/DeviceDoc/avr8-gnu-toolchain-installer-3.5.4.91-win32.any.x86.exe"
7z x avr8-gnu-toolchain-installer-3.5.4.91-win32.any.x86.exe
rm avr8-gnu-toolchain-installer-3.5.4.91-win32.any.x86.exe
pacman --needed -S mingw-w64-x86_64-avrdude
}

function install_arm {
Expand Down

0 comments on commit 524053e

Please sign in to comment.