aboutsummaryrefslogtreecommitdiff
path: root/support
diff options
context:
space:
mode:
authorPerry Hung <iperry@gmail.com>2011-05-27 06:54:00 -0400
committerPerry Hung <iperry@gmail.com>2011-05-27 06:55:10 -0400
commit949927dbb044e74901b217a6a1655f3561c6e4e8 (patch)
treeffcfe32eac051867eccff262a29e8d3507573933 /support
parentdc98e6c5aa3f6a8c913fe6089333c6d61877002f (diff)
openocd: Add missing file
Forgot openocd support script in 0e5eb75c80bd8036bf85bfe0cce09d1fce56f50a.
Diffstat (limited to 'support')
-rwxr-xr-xsupport/scripts/openocd-wrapper.sh16
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