ao-bringup: get turnon_easymega working for v2.0
authorBdale Garbee <bdale@gag.com>
Mon, 31 Dec 2018 19:37:45 +0000 (12:37 -0700)
committerBdale Garbee <bdale@gag.com>
Mon, 31 Dec 2018 19:39:34 +0000 (12:39 -0700)
ao-bringup/test-easymega
ao-bringup/test-easymega-v1.0 [new file with mode: 0755]
ao-bringup/turnon_easymega

index 2f0a782..1e419b4 100755 (executable)
@@ -1,25 +1,25 @@
 #!/bin/sh
 
-VERSION=1.0
+VERSION=2.0
 PRODUCT=EasyMega
 BASE=`echo $PRODUCT | tr 'A-Z' 'a-z'`
 
 echo "$PRODUCT-v$VERSION Test Program"
-echo "Copyright 2014 by Keith Packard.  Released under GPL v2"
+echo "Copyright 2018 by Bdale Garbee.  Released under GPL v2"
 echo
 echo "Expectations:"
 echo "\t$PRODUCT v$VERSION powered from USB"
 echo
 
 ret=1
-../ao-tools/ao-list/ao-list | while read product serial dev; do
+ao-list | while read product serial dev; do
     case "$product" in
        "$PRODUCT-v$VERSION")
 
            echo "Testing $product $serial $dev"
            echo ""
 
-           ./test-igniters $dev drogue main 0 1 2 3
+           ./test-igniters $dev main drogue 3 0 1 2
            echo""
 
            echo "Testing baro sensor"
diff --git a/ao-bringup/test-easymega-v1.0 b/ao-bringup/test-easymega-v1.0
new file mode 100755 (executable)
index 0000000..2f0a782
--- /dev/null
@@ -0,0 +1,55 @@
+#!/bin/sh
+
+VERSION=1.0
+PRODUCT=EasyMega
+BASE=`echo $PRODUCT | tr 'A-Z' 'a-z'`
+
+echo "$PRODUCT-v$VERSION Test Program"
+echo "Copyright 2014 by Keith Packard.  Released under GPL v2"
+echo
+echo "Expectations:"
+echo "\t$PRODUCT v$VERSION powered from USB"
+echo
+
+ret=1
+../ao-tools/ao-list/ao-list | while read product serial dev; do
+    case "$product" in
+       "$PRODUCT-v$VERSION")
+
+           echo "Testing $product $serial $dev"
+           echo ""
+
+           ./test-igniters $dev drogue main 0 1 2 3
+           echo""
+
+           echo "Testing baro sensor"
+           ../ao-tools/ao-test-baro/ao-test-baro --tty="$dev"
+
+           case $? in
+               0)
+                   ;;
+               *)
+                   echo "failed"
+                   exit 1
+           esac
+           echo""
+
+           FLASHSIZE=8388608
+
+           echo "Testing flash"
+           ../ao-tools/ao-test-flash/ao-test-flash --tty="$dev" "$FLASHSIZE"
+
+           case $? in
+               0)
+                   ;;
+               *)
+                   echo "failed"
+                   exit 1
+           esac
+           echo""
+
+           echo "$PRODUCT-v$VERSION" serial "$serial" is ready to ship
+           ret=0
+           ;;
+    esac
+done
index 9de8d98..64180bd 100755 (executable)
@@ -4,15 +4,15 @@ PRODUCT=EasyMega
 VERSION=2.0
 REPO=~/altusmetrumllc/Binaries
 
-if [ -x ../ao-tools/ao-flash/ao-flash-stm ]; then
-       STMLOAD=../ao-tools/ao-flash/ao-flash-stm
+if [ -x /usr/bin/ao-flash-stm ]; then
+       FLASH_STM=/usr/bin/ao-flash-stm
 else
        echo "Can't find ao-flash-stm!  Aborting."
        exit 1
 fi
 
-if [ -x ../ao-tools/ao-usbload/ao-usbload ]; then
-       USBLOAD=../ao-tools/ao-usbload/ao-usbload
+if [ -x /usr/bin/ao-usbload ]; then
+       USBLOAD=/usr/bin/ao-usbload
 else
        echo "Can't find ao-usbload!  Aborting."
        exit 1
@@ -42,17 +42,17 @@ case $# in
        ;;
 esac
 
-echo $STMLOAD
+echo $FLASH_STM
 
-$STMLOAD $REPO/loaders/easymega-v$VERSION*.elf || exit 1
+$FLASH_STM $REPO/loaders/easymega-v$VERSION*.elf
 
-sleep 2
+sleep 3
 
 $USBLOAD --serial=$SERIAL $REPO/easymega-v$VERSION*.elf || exit 1
 
-sleep 2
+sleep 5
 
-dev=`../ao-tools/ao-list/ao-list | awk '/'"$PRODUCT"'-v'"$VERSION"'/ { print $3; exit(0); }'`
+dev=`ao-list | awk '/'"$PRODUCT"'-v'"$VERSION"'/ { print $3; exit(0); }'`
 
 case "$dev" in
 /dev/tty*)
@@ -66,7 +66,11 @@ esac
 
 echo 'E 0' > $dev
 
-../ao-tools/ao-cal-accel/ao-cal-accel $dev || exit 1
+failed=1
+while [ $failed =  1 ]; do
+    ../ao-tools/ao-cal-accel/ao-cal-accel $dev
+    failed=$?
+done
 
 echo 'E 1' > $dev