summaryrefslogtreecommitdiff
path: root/tools/reset_lufa_cdc
diff options
context:
space:
mode:
Diffstat (limited to 'tools/reset_lufa_cdc')
-rwxr-xr-xtools/reset_lufa_cdc17
1 files changed, 9 insertions, 8 deletions
diff --git a/tools/reset_lufa_cdc b/tools/reset_lufa_cdc
index 09cc8cb..6529884 100755
--- a/tools/reset_lufa_cdc
+++ b/tools/reset_lufa_cdc
@@ -1,15 +1,16 @@
-#!/bin/bash
+#!/bin/zsh --multios
+#(c) Bernhard Tittelbach
-DEVICE_FILE="/dev/ttyACM0"
+LUFA_CDC_DEVS=($(${0:h}/detect_lufa_cdc))
-if [ -c $DEVICE_FILE ]; then
- echo "resetting device .."
- echo $1 > /dev/ttyACM0
+if [[ ${#LUFA_CDC_DEVS} -gt 0 ]]; then
+ echo "resetting device(s) $LUFA_CDC_DEVS ..."
+ echo $1 > ${LUFA_CDC_DEVS}
- echo "waiting for device to enumerate .."
- sleep 4
+ echo "waiting for device to enumerate .."
+ sleep 3
else
- echo "'$DEVICE_FILE' not found ... device is probably already in bootloader mode - doing nothing"
+ echo "LUFA ttyACMs not found ... device is probably already in bootloader mode - doing nothing"
fi
exit 0