annotate scripts/run_project.sh @ 68:59edd5780fef

Changed d-box code to run cleanly when built on board. Updated Makefile to add ne10 include path on board. Some extra docs in Utilities.h
author andrewm
date Fri, 17 Jul 2015 16:57:08 +0100
parents 3ada83df91a5
children 91e1a3a220d4
rev   line source
andrewm@58 1 #!/bin/bash
andrewm@58 2 #
andrewm@58 3 # This script runs an already-compiled BeagleRT project on the
andrewm@58 4 # BeagleBone Black.
andrewm@58 5
andrewm@58 6 BBB_ADDRESS="root@192.168.7.2"
andrewm@58 7 BBB_PATH="~/BeagleRT"
andrewm@60 8 COMMAND_ARGS=
andrewm@62 9 RUN_IN_FOREGROUND=0
andrewm@58 10
andrewm@58 11 function usage
andrewm@58 12 {
andrewm@58 13 THIS_SCRIPT=`basename "$0"`
andrewm@62 14 echo "Usage: $THIS_SCRIPT [-b path-on-beaglebone] [-c command-line-args] [-f]"
andrewm@58 15
andrewm@58 16 echo "
andrewm@58 17 This script runs a previously compiled BeagleRT project on the
andrewm@58 18 BeagleBone Black. The -b option changes the default path, which
andrewm@60 19 is otherwise $BBB_PATH. The -c option passes command-line arguments
andrewm@62 20 to the BeagleRT program; enclose the argument string in quotes.
andrewm@62 21 The -f argument runs the project in the foreground of the current terminal,
andrewm@62 22 within a screen session that can be detached later."
andrewm@58 23 }
andrewm@58 24
andrewm@58 25 OPTIND=1
andrewm@58 26
andrewm@62 27 while getopts "b:c:fh" opt; do
andrewm@58 28 case $opt in
andrewm@58 29 b) BBB_PATH=$OPTARG
andrewm@58 30 ;;
andrewm@60 31 c) COMMAND_ARGS=$OPTARG
andrewm@60 32 ;;
andrewm@62 33 f) RUN_IN_FOREGROUND=1
andrewm@62 34 ;;
andrewm@58 35 h|\?) usage
andrewm@58 36 exit 1
andrewm@58 37 esac
andrewm@58 38 done
andrewm@58 39
andrewm@58 40 shift $((OPTIND-1))
andrewm@58 41
andrewm@58 42 echo "Running BeagleRT..."
andrewm@62 43 if [ $RUN_IN_FOREGROUND -eq 0 ]
andrewm@62 44 then
andrewm@63 45 ssh $BBB_ADDRESS "screen -X -S BeagleRT quit ; pkill BeagleRT ; sleep 0.5 ; screen -S BeagleRT -d -m $BBB_PATH/BeagleRT $COMMAND_ARGS"
andrewm@62 46 else
andrewm@63 47 ssh -t $BBB_ADDRESS "screen -X -S BeagleRT quit ; pkill BeagleRT ; sleep 0.5 ; screen -S BeagleRT $BBB_PATH/BeagleRT $COMMAND_ARGS"
andrewm@62 48 fi