summaryrefslogtreecommitdiff
path: root/launch-openocd
diff options
context:
space:
mode:
authorTrygve Laugstøl <trygvis@inamo.no>2017-05-11 11:36:52 +0200
committerTrygve Laugstøl <trygvis@inamo.no>2017-05-11 11:36:52 +0200
commit8665bdbf682bdff02576a6f4393f09bc56572043 (patch)
tree54b1f51c0b3e5f5dd577720a9cd54e28be19d97f /launch-openocd
parenteabbd037f5f605a9ecf06185cd62594eb4564bce (diff)
downloadradio-controller-8665bdbf682bdff02576a6f4393f09bc56572043.tar.gz
radio-controller-8665bdbf682bdff02576a6f4393f09bc56572043.tar.bz2
radio-controller-8665bdbf682bdff02576a6f4393f09bc56572043.tar.xz
radio-controller-8665bdbf682bdff02576a6f4393f09bc56572043.zip
wip
Diffstat (limited to 'launch-openocd')
-rwxr-xr-xlaunch-openocd16
1 files changed, 16 insertions, 0 deletions
diff --git a/launch-openocd b/launch-openocd
new file mode 100755
index 0000000..18b30b2
--- /dev/null
+++ b/launch-openocd
@@ -0,0 +1,16 @@
+#!/bin/sh
+
+stlinkv2=$(lsusb -d 0483:374b | wc -l)
+olimex=$(lsusb -d 15ba:002a | wc -l)
+
+DEVICE=
+if [ $stlinkv2 -gt 0 ]
+then
+ DEVICE=stlinkv2
+elif [ $olimex -gt 0 ]
+then
+ DEVICE=olimex-arm-usb-tiny-h
+fi
+
+export DEVICE
+exec openocd -f openocd.cfg