summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorChristian Pointner <equinox@spreadspace.org>2015-09-19 15:05:36 +0200
committerChristian Pointner <equinox@spreadspace.org>2015-09-19 15:05:36 +0200
commit41b3974f3d696fa8152ea61c98f41ca8b2a56cd2 (patch)
tree4b6280771bdc82d582f891aaa4bc70452f681b6f
parentadded reset lufa cdc version without wait (diff)
improved reset-lufa-cdc helper
-rwxr-xr-xtools/reset_lufa_cdc14
-rwxr-xr-xtools/reset_lufa_cdc_nowait10
2 files changed, 18 insertions, 6 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
diff --git a/tools/reset_lufa_cdc_nowait b/tools/reset_lufa_cdc_nowait
index 47587ac..ac47368 100755
--- a/tools/reset_lufa_cdc_nowait
+++ b/tools/reset_lufa_cdc_nowait
@@ -1,6 +1,12 @@
#!/bin/bash
-echo "resetting device .."
-echo $1 > /dev/ttyACM0
+DEVICE_FILE="/dev/ttyACM0"
+
+if [ -c $DEVICE_FILE ]; then
+ echo "resetting device .."
+ echo $1 > /dev/ttyACM0
+else
+ echo "'$DEVICE_FILE' not found ... device is probably already in bootloader mode - doing nothing"
+fi
exit 0