summaryrefslogtreecommitdiff
path: root/tools
diff options
context:
space:
mode:
authorBernhard Tittelbach <bernhard@tittelbach.org>2016-06-12 05:06:11 +0200
committerBernhard Tittelbach <bernhard@tittelbach.org>2016-06-12 06:36:54 +0200
commitc35b4171d0cd2b370262ae2bb772f627b1f6d7b9 (patch)
tree5c7cf01c594791c5321d7bb3c4f7de1d6b9816c4 /tools
parentRevert "bmp180 pressure sensor, just lacks arduino i2c-wire-lib and testing" (diff)
ArduinoProMicro
Diffstat (limited to 'tools')
-rwxr-xr-xtools/detect_newest_acm4
-rwxr-xr-xtools/reset_sparkfun40
2 files changed, 44 insertions, 0 deletions
diff --git a/tools/detect_newest_acm b/tools/detect_newest_acm
new file mode 100755
index 0000000..a9d850f
--- /dev/null
+++ b/tools/detect_newest_acm
@@ -0,0 +1,4 @@
+#!/bin/zsh
+#(c) Bernhard Tittelbach
+print /dev/ttyACM*(NOc[-1])
+
diff --git a/tools/reset_sparkfun b/tools/reset_sparkfun
new file mode 100755
index 0000000..fd3cd05
--- /dev/null
+++ b/tools/reset_sparkfun
@@ -0,0 +1,40 @@
+#!/bin/sh
+#(c) Bernhard Tittelbach
+
+if [ -z "$1" ]; then
+ IDS="03eb:204b"
+else
+ IDS=$1
+fi
+
+WAIT_MAX=20
+
+FOUND=0
+DISAPPEARED=0
+echo -n "Please double-tap GND to the RST pin"
+i=$WAIT_MAX
+while (test $i -gt 0); do
+ echo -n "."
+ for id in $IDS; do
+ lsusb -d $id > /dev/null 2>&1
+ if [ $? -eq 0 ]; then
+ FOUND=1
+ [[ $DISAPPEARED -eq 1 ]] && break;
+ else
+ [[ $FOUND -eq 1 ]] && DISAPPEARED=1;
+ fi
+ done
+ if [ $FOUND -eq 1 -a $DISAPPEARED -eq 1 ]; then
+ break;
+ fi
+ sleep 1
+ i=$(($i-1))
+done
+
+if [ $FOUND -eq 1 ]; then
+ echo " device found!"
+else
+ echo " timout - trying anyway"
+fi
+
+exit 0