3 if [ -x ../ao-tools/ao-flash/ao-flash-lpc ]; then
4 FLASH_LPC=../ao-tools/ao-flash/ao-flash-lpc
5 elif [ -x /usr/bin/ao-flash-lpc ]; then
6 FLASH_LPC=/usr/bin/ao-flash-lpc
8 echo "Can't find ao-flash-lpc! Aborting."
12 if [ -x /usr/bin/ao-usbload ]; then
13 USBLOAD=/usr/bin/ao-usbload
15 echo "Can't find ao-usbload! Aborting."
21 BASE=`echo $PRODUCT | tr 'A-Z' 'a-z'`
24 echo "$PRODUCT v$VERSION Turn-On and Calibration Program"
25 echo "Copyright 2014 by Bdale Garbee. Released under GPL v2"
28 echo "\t$PRODUCT v$VERSION powered from USB"
29 echo "\t\twith ST-Link-V2 cabled to debug header"
35 echo "$PRODUCT-$VERSION serial number: $SERIAL"
38 echo -n "$PRODUCT-$VERSION serial number: "
42 echo "Usage: $0 <serial-number>" 1>&2
48 # Use released versions of everything
50 FLASH_FILE=~/altusmetrumllc/Binaries/loaders/telegps-v1.0-altos-flash-*.elf
51 ALTOS_FILE=~/altusmetrumllc/Binaries/telegps-v1.0-*.elf
53 echo $FLASH_LPC $FLASH_FILE
55 $FLASH_LPC $FLASH_FILE || exit 1
59 echo $USBLOAD $ALTOS_FILE
61 $USBLOAD --serial=$SERIAL $ALTOS_FILE || exit 1
65 dev=`ao-list | awk '/TeleGPS-v'"$VERSION"'/ { print $3; exit(0); }'`
69 echo "TeleGPS found on $dev"
72 echo 'No TeleGPS-v'"$VERSION"' found'
77 SERIAL=$SERIAL ./cal-freq $dev