5 if [ -x ../ao-tools/ao-flash/ao-flash-stm ]; then
6 STMLOAD=../ao-tools/ao-flash/ao-flash-stm
8 echo "Can't find ao-flash-stm! Aborting."
12 if [ -x ../ao-tools/ao-usbload/ao-usbload ]; then
13 USBLOAD=../ao-tools/ao-usbload/ao-usbload
15 echo "Can't find ao-usbload! Aborting."
20 REPO=~/altusmetrumllc/Binaries
22 echo "$PRODUCT v$VERSION Turn-On and Calibration Program"
23 echo "Copyright 2014 by Bdale Garbee. Released under GPL v2"
26 echo "\t$PRODUCT v$VERSION"
27 echo "\t\twith USB cable attached"
28 echo "\t\twith ST-Link-V2 cabled to debug header"
34 echo "$PRODUCT-$VERSION serial number: $SERIAL"
37 echo -n "$PRODUCT-$VERSION serial number: "
41 echo "Usage: $0 <serial-number>" 1>&2
48 $STMLOAD $REPO/loaders/easymega-v$VERSION*.elf || exit 1
52 $USBLOAD --serial=$SERIAL $REPO/easymega-v$VERSION*.elf || exit 1
56 dev=`../ao-tools/ao-list/ao-list | awk '/'"$PRODUCT"'-v'"$VERSION"'/ { print $3; exit(0); }'`
60 echo "$PRODUCT found on $dev"
63 echo 'No '"$PRODUCT"'-v'"$VERSION"' found'
70 ../ao-tools/ao-cal-accel/ao-cal-accel $dev || exit 1