Skip to content

Instantly share code, notes, and snippets.

@feiz
Forked from nyomo/avrdude.sh
Last active December 22, 2018 18:44
Show Gist options
  • Save feiz/21293cbdff8a2e70b2d0af1389f2f279 to your computer and use it in GitHub Desktop.
Save feiz/21293cbdff8a2e70b2d0af1389f2f279 to your computer and use it in GitHub Desktop.
WSLでavrdudeを簡単に使う為の奴 qmk用
MODECMD='/mnt/c/Windows/System32/mode.com'
COMPORT1=$(${MODECMD}|grep -o 'COM[0-9]*')
COMPORT2=""
while [ "$COMPORT2" = "" ];do
sleep 0.5
printf "."
COMPORT2=$(${MODECMD}|grep -v '${COMPORT1}'|grep -o 'COM[0-9]*')
done
PORTNUM=$(echo $COMPORT2|sed -e 's/COM//')
avrdude -c avr109 -p atmega32u4 -P /dev/ttyS${PORTNUM} -U flash:w:$*
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment