3 if [ -x /usr/bin/ao-flash-stm ]; then
4 STMLOAD=/usr/bin/ao-flash-stm
6 echo "Can't find ao-flash-stm! Aborting."
10 if [ -x /usr/bin/ao-usbload ]; then
11 USBLOAD=/usr/bin/ao-usbload
13 echo "Can't find ao-usbload! Aborting."
18 REPO=~/altusmetrumllc/Binaries
20 echo "EasyMega v$VERSION Turn-On and Calibration Program"
21 echo "Copyright 2014 by Bdale Garbee. Released under GPL v2"
24 echo "\tEasyMega v$VERSION"
25 echo "\t\twith USB cable attached"
26 echo "\t\twith ST-Link-V2 cabled to debug header"
28 echo -n "EasyMega-$VERSION serial number: "
33 $STMLOAD $REPO/loaders/easymega-v$VERSION*.elf || exit 1
37 $USBLOAD --serial=$SERIAL $REPO/easymega-v$VERSION*.elf || exit 1
41 dev=`ao-list | awk '/EasyMega-v'"$VERSION"'/ { print $3; exit(0); }'`
45 echo "EasyMega found on $dev"
48 echo 'No EasyMega-v'"$VERSION"' found'
55 ../ao-tools/ao-cal-accel/ao-cal-accel $dev