4 usage () { echo 'usage: write-firmware FILE [PORT]'; }
7 ourfile="$home/Marlin.hex"
12 1) shift; port=/dev/ttyUSB0 ;;
13 2) shift; port="$1"; shift ;;
14 *) usage >&2; exit 1;;
18 avrdude -b 38400 -v -P $port -p atmega644P -c arduino "$@"
21 cp -v -- "$infile" "$ourfile"
24 ad "$@" -U flash:w:$ourfile