diff options
author | Perry Hung <iperry@gmail.com> | 2011-05-27 06:54:00 -0400 |
---|---|---|
committer | Perry Hung <iperry@gmail.com> | 2011-05-27 06:55:10 -0400 |
commit | eb25aa623fb3cdbc131c966fe2c516caa85da7a7 (patch) | |
tree | 10f0288dec97fb0d7003f96f791c2a716455ecc0 /support/scripts | |
parent | ec67102373dad97b8fa1d9494f97fe45ea9d9d30 (diff) | |
download | librambutan-eb25aa623fb3cdbc131c966fe2c516caa85da7a7.tar.gz librambutan-eb25aa623fb3cdbc131c966fe2c516caa85da7a7.zip |
openocd: Add missing file
Forgot openocd support script in
0e5eb75c80bd8036bf85bfe0cce09d1fce56f50a.
Diffstat (limited to 'support/scripts')
-rwxr-xr-x | support/scripts/openocd-wrapper.sh | 16 |
1 files changed, 16 insertions, 0 deletions
diff --git a/support/scripts/openocd-wrapper.sh b/support/scripts/openocd-wrapper.sh new file mode 100755 index 0000000..73be92e --- /dev/null +++ b/support/scripts/openocd-wrapper.sh @@ -0,0 +1,16 @@ +#!/usr/bin/env bash + +# Helper to decide which openocd script to use. We only support 0.3.x and 0.4.x. + +if [ $# -ne 1 ] +then + echo "Usage: `basename $0` {flash|debug}" + exit 1 +fi + +OPENOCD_VERSION=`openocd -v 2>&1 | head -n1 | \ + awk '{print $4}' | sed 's/\([0-9]*\.[0-9]*\)\.[0-9]*/\1/'` + +CFG_FILE=$1_${OPENOCD_VERSION}.cfg + +openocd -f support/openocd/$CFG_FILE |