Merge branch 'master'
[fw/altos] / ao-bringup / test-easymotor-v3
1 #!/bin/sh
2
3 VERSION=3
4 PRODUCT=EasyMotor
5 BASE=`echo $PRODUCT | tr 'A-Z' 'a-z'`
6
7 echo "$PRODUCT-v$VERSION Test Program"
8 echo "Copyright 2022 by Bdale Garbee.  Released under GPL v3"
9 echo
10 echo "Expectations:"
11 echo "\t$PRODUCT v$VERSION powered from USB"
12 echo "\t\tand precision 2:1 resistor divider feeding pressure input from 5V out"
13 echo
14
15 ret=1
16 ao-list | while read product serial dev; do
17     case "$product" in
18         "$PRODUCT-v$VERSION")
19
20             echo "Testing $product $serial $dev"
21             echo ""
22
23             FLASHSIZE=8388608
24
25             echo "Testing flash"
26             ../ao-tools/ao-test-flash/ao-test-flash --tty="$dev" "$FLASHSIZE"
27
28             echo "" 
29
30             echo "Testing pressure sensor input"
31             ../ao-tools/ao-test-pressure/ao-test-pressure --tty="$dev" 
32
33             case $? in
34                 0)
35                     ;;
36                 *)
37                     echo "failed"
38                     exit 1
39             esac
40             echo""
41
42             echo "$PRODUCT-v$VERSION" serial "$serial" is ready to ship
43             ret=0
44             ;;
45     esac
46 done