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 ../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."
23 BASE=`echo $PRODUCT | tr 'A-Z' 'a-z'`
26 echo "$PRODUCT v$VERSION Turn-On and Calibration Program"
27 echo "Copyright 2010 by Bdale Garbee. Released under GPL v2"
30 echo "\t$PRODUCT v$VERSION powered from USB"
31 echo "\t\twith ST-Link-V2 cabled to debug header"
33 echo -n "$PRODUCT-$VERSION serial number: "
38 $FLASH_LPC ../src/$BASE-v$VERSION/flash-loader/$BASE-v$VERSION-altos-flash-*.elf || exit 1
44 $USBLOAD --serial=$SERIAL ../src/$BASE-v$VERSION/*.ihx || exit 1
48 dev=`ao-list | awk '/'"$PRODUCT"'-v'"$VERSION"'/ { print $3; exit(0); }'`
52 echo "$PRODUCT found on $dev"
55 echo 'No '"$PRODUCT"'-v'"$VERSION"' found'
60 echo "Testing igniters. Both should flash"
61 ./test-igniter "$dev" drogue main
71 echo "Testing baro sensor"
85 ./test-flash "$dev" "$FLASHSIZE"
95 echo "$PRODUCT-v$VERSION" serial "$SERIAL" is ready to ship