summaryrefslogtreecommitdiff
path: root/tools/reset_lufa_cdc
diff options
context:
space:
mode:
Diffstat (limited to 'tools/reset_lufa_cdc')
-rwxr-xr-xtools/reset_lufa_cdc14
1 files changed, 10 insertions, 4 deletions
diff --git a/tools/reset_lufa_cdc b/tools/reset_lufa_cdc
index d1f4a80..09cc8cb 100755
--- a/tools/reset_lufa_cdc
+++ b/tools/reset_lufa_cdc
@@ -1,9 +1,15 @@
#!/bin/bash
-echo "resetting device .."
-echo $1 > /dev/ttyACM0
+DEVICE_FILE="/dev/ttyACM0"
-echo "waiting for device to enumerate .."
-sleep 4
+if [ -c $DEVICE_FILE ]; then
+ echo "resetting device .."
+ echo $1 > /dev/ttyACM0
+
+ echo "waiting for device to enumerate .."
+ sleep 4
+else
+ echo "'$DEVICE_FILE' not found ... device is probably already in bootloader mode - doing nothing"
+fi
exit 0