3 if [ -x ../ao-tools/ao-stmload/ao-stmload ]; then
4 STMLOAD=../ao-tools/ao-stmload/ao-stmload
5 elif [ -x /usr/bin/ao-stmload ]; then
6 STMLOAD=/usr/bin/ao-stmload
8 echo "Can't find ao-stmload! Aborting."
12 if [ -x ../ao-tools/ao-usbload/ao-usbload ]; then
13 USBLOAD=../ao-tools/ao-usbload/ao-usbload
14 elif [ -x /usr/bin/ao-usbload ]; then
15 USBLOAD=/usr/bin/ao-usbload
17 echo "Can't find ao-usbload! Aborting."
24 echo "TeleMega v$VERSION Turn-On and Calibration Program"
25 echo "Copyright 2010 by Bdale Garbee. Released under GPL v2"
28 echo "\tTeleMega v$VERSIOn powered from USB"
29 echo "\t\twith ST-Link-V2 cabled to debug header"
30 echo "\t\twith coax from UHF to frequency counter"
32 echo -n "TeleMega-$VERSION serial number: "
37 $STMLOAD --raw ../src/telemega-v$VERSION/flash-loader/*.elf || exit 1
41 $USBLOAD --serial=$SERIAL ../src/telemega-v$VERSION/*.ihx || exit 1
45 dev=`ao-list | awk '/TeleMega-v'"$VERSION"'/ { print $3; exit(0); }'`
49 echo "TeleMega found on $dev"
52 echo 'No TeleMega-v'"$VERSION"' found'
59 SERIAL=$SERIAL ./cal-freq $dev