Skip to content
This repository was archived by the owner on Aug 5, 2022. It is now read-only.

Commit 3c51ce7

Browse files
author
David Hunt
committed
ATLEDGE-213 Added a retry mechanism that times out after 10 seconds.
Signed-off-by: David Hunt <[email protected]>
1 parent b372792 commit 3c51ce7

File tree

1 file changed

+11
-5
lines changed

1 file changed

+11
-5
lines changed

clupload/cluploadEDU_osx.sh

Lines changed: 11 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -21,13 +21,19 @@ DYLD_LIBRARY_PATH=$fixed_path
2121
DFU=$fixed_path/dfu-util
2222

2323
echo "wating for device... "
24-
f=`DYLD_LIBRARY_PATH=$fixed_path $DFU -l | grep 8087:0a99 | grep sensor_core | cut -f 1 -d ' '`
25-
while [ "x$f" = "x" ]
24+
COUNTER=0
25+
f=`DYLD_LIBRARY_PATH=$fixed_path $DFU -l -d8087:0a99 | grep sensor_core | cut -f 1 -d ' '`
26+
while [ "x$f" = "x" ] && [ $COUNTER -lt 10 ]
2627
do
28+
let COUNTER=COUNTER+1
2729
sleep 1
2830
echo $DFU
29-
f=`DYLD_LIBRARY_PATH=$fixed_path $DFU -l | grep 8087:0a99 | grep sensor_core | cut -f 1 -d ' '`
31+
f=`DYLD_LIBRARY_PATH=$fixed_path $DFU -l -d8087:0a99 | grep sensor_core | cut -f 1 -d ' '`
3032
done
3133

32-
echo "Using dfu-util to send " $bin_file_name
33-
DYLD_LIBRARY_PATH=$fixed_path $DFU -d8087:0a99 -D $bin_file_name -v --alt 7 -R
34+
if [ "x$f" != "x" ] ; then
35+
echo "Using dfu-util to send " $bin_file_name
36+
DYLD_LIBRARY_PATH=$fixed_path $DFU -d8087:0a99 -D $bin_file_name -v --alt 7 -R
37+
else
38+
echo "ERROR: Timed out waiting for Intel EDU."
39+
fi

0 commit comments

Comments
 (0)