altosui: Add config and pyro tabs to graph widget
[fw/altos] / ao-bringup / turnon_easytimer
1 #!/bin/sh
2
3 # EasyTimer v2 all arrive from the assembler with 
4 # the bootloader already flashed. 
5
6 if [ -x /usr/bin/ao-usbload ]; then
7         USBLOAD=/usr/bin/ao-usbload
8 else
9         echo "Can't find ao-usbload!  Aborting."
10         exit 1
11 fi
12
13 VERSION=2
14 REPO=~/altusmetrumllc/Binaries
15 PRODUCT=EasyTimer
16
17 echo "$PRODUCT v$VERSION Turn-On and Calibration Program"
18 echo "Copyright 2024 by Bdale Garbee.  Released under GPL v3"
19 echo
20 echo "Expectations:"
21 echo "\t$PRODUCT v$VERSION powered from USB"
22 echo
23
24 case $# in
25     1)
26         SERIAL="$1"
27         echo "$PRODUCT-$VERSION serial number: $SERIAL" 
28         ;;
29     0)
30         echo -n "$PRODUCT-$VERSION serial number: "
31         read SERIAL
32         ;;
33     *)
34         echo "Usage: $0 <serial-number>" 1>&2
35         exit 1;
36         ;;
37 esac
38
39 $USBLOAD --serial=$SERIAL --force $REPO/easytimer-v$VERSION*.elf || exit 1
40
41 sleep 5
42
43 dev=`ao-list | awk '/EasyTimer-v'"$VERSION"'/ { print $3; exit(0); }'`
44
45 case "$dev" in
46 /dev/tty*)
47         echo "EasyTimer found on $dev"
48         ;;
49 *)
50         echo 'No EasyTimer-v'"$VERSION"' found'
51         exit 1
52         ;;
53 esac
54
55 echo 'E 0' > $dev
56
57 failed=1
58 while [ $failed = 1 ]; do
59     ../ao-tools/ao-cal-accel/ao-cal-accel $dev
60     failed=$?
61 done
62
63 echo 'E 1' > $dev
64
65 ./test-easytimer-v2
66
67 exit $?