Created
May 13, 2019 16:44
-
-
Save joshuabenuck/78f5fb6889b0c002002a933a6b2b8fe2 to your computer and use it in GitHub Desktop.
Script to reflash QMK firmware from the command line.
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
if [[ "$1" == "" ]]; then | |
echo "Usage: ./reflash.sh <firmware>" | |
exit | |
fi | |
echo "Press reset on your board..." | |
while true; do | |
ls /dev/cu.u* > /dev/null 2>&1 | |
if [[ $? -eq 0 ]]; then | |
export DEV=$(ls /dev/cu.u*) | |
avrdude -patmega32u4 -cavr109 -b57600 -Uflash:w:$1 -P$DEV | |
break | |
fi | |
sleep 1 | |
done |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment