3 if [ -x /usr/bin/ao-flash-lpc ]; then
4 FLASH_LPC=/usr/bin/ao-flash-lpc
6 echo "Can't find ao-flash-lpc! Aborting."
10 if [ -x /usr/bin/ao-usbload ]; then
11 USBLOAD=/usr/bin/ao-usbload
13 echo "Can't find ao-usbload! Aborting."
19 BASE=`echo $PRODUCT | tr 'A-Z' 'a-z'`
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 powered from USB"
27 echo "\t\twith ST-Link-V2 cabled to debug header"
33 echo "$PRODUCT-$VERSION serial number: $SERIAL"
36 echo -n "$PRODUCT-$VERSION serial number: "
40 echo "Usage: $0 <serial-number>" 1>&2
46 # Use released versions of everything
48 FLASH_FILE=~/altusmetrumllc/Binaries/loaders/telegps-v1.0-altos-flash-*.elf
49 ALTOS_FILE=~/altusmetrumllc/Binaries/telegps-v1.0-*.elf
51 echo $FLASH_LPC $FLASH_FILE
53 $FLASH_LPC $FLASH_FILE || exit 1
57 echo $USBLOAD $ALTOS_FILE
59 $USBLOAD --serial=$SERIAL $ALTOS_FILE || exit 1
63 dev=`ao-list | awk '/TeleGPS-v'"$VERSION"'/ { print $3; exit(0); }'`
67 echo "TeleGPS found on $dev"
70 echo 'No TeleGPS-v'"$VERSION"' found'
75 SERIAL=$SERIAL ./cal-freq $dev