Skip to content

Instantly share code, notes, and snippets.

@nyomo
Last active Jan 4, 2021
Embed
What would you like to do?
WSLでavrdudeを簡単に使う為の奴
#つかいかた
#書き込みたいファイルのPATHの変換やってないのでディレクトリ指定があると駄目かも
#sh avrdude.sh 書き込みたいファイル.hex
#ここにbin/avrdude.exeとetc/avrdude.confのあるディレクトリをLinuxの形式で書く
AVRDIR="/mnt/c/Users/nyomoko/tools/arduino/hardware/tools/avr/"
WINDIR=$(echo ${AVRDIR}|sed -e 's/\/mnt\/c\//C:\\/'|sed -e 's/\//\\/g')
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
echo $COMPORT2
${AVRDIR}bin/avrdude.exe -C ${WINDIR}\etc\\avrdude.conf -c avr109 -p m32u4 -P ${COMPORT2} -U flash:w:$*
@nyomo

This comment has been minimized.

Copy link
Owner Author

@nyomo nyomo commented Jun 6, 2018

これでcmd立ち上げなくて大丈夫な筈だー(∩´∀`)∩ワーイ

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment