diff options
| author | Marti Bolivar <mbolivar@leaflabs.com> | 2012-06-07 01:24:01 -0400 |
|---|---|---|
| committer | Marti Bolivar <mbolivar@leaflabs.com> | 2012-06-07 03:40:11 -0400 |
| commit | 0d8f8e058d8361e2a52d9f0f9c0994872f942600 (patch) | |
| tree | f5e5c38175307dbda5cd13b117e6c43f3298f635 /contrib/openocd/openocd-wrapper.sh | |
| parent | 131e98ab67bff5c6fa5d0c0e05663e48a0b93b6f (diff) | |
Move OpenOCD stuff into contrib/.
This has gone unmaintained for long enough.
Signed-off-by: Marti Bolivar <mbolivar@leaflabs.com>
Diffstat (limited to 'contrib/openocd/openocd-wrapper.sh')
| -rwxr-xr-x | contrib/openocd/openocd-wrapper.sh | 16 |
1 files changed, 16 insertions, 0 deletions
diff --git a/contrib/openocd/openocd-wrapper.sh b/contrib/openocd/openocd-wrapper.sh new file mode 100755 index 0000000..73be92e --- /dev/null +++ b/contrib/openocd/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 |
