Skip to content

Instantly share code, notes, and snippets.

@joshuabenuck
Created May 13, 2019 16:44
Show Gist options
  • Save joshuabenuck/78f5fb6889b0c002002a933a6b2b8fe2 to your computer and use it in GitHub Desktop.
Save joshuabenuck/78f5fb6889b0c002002a933a6b2b8fe2 to your computer and use it in GitHub Desktop.
Script to reflash QMK firmware from the command line.
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