File tree 5 files changed +24
-12
lines changed
5 files changed +24
-12
lines changed Original file line number Diff line number Diff line change
1
+ #! /bin/bash
2
+ #
3
+ # Use the correct dfu-util program based on the architecture
4
+ #
5
+
6
+ # Get the directory where the script is running.
7
+ DIR=$( cd " $( dirname " ${BASH_SOURCE[0]} " ) " && pwd )
8
+
9
+ # Choose dfu program by arch
10
+ if [ ` uname -m` == " x86_64" ]; then
11
+ DFU_UTIL=${DIR} /dfu-util_x86_64/dfu-util
12
+ else
13
+ DFU_UTIL=${DIR} /dfu-util/dfu-util
14
+ fi
15
+
16
+ # Not found!
17
+ if [ ! -x " ${DFU_UTIL} " ]; then
18
+ echo " $0 : error: cannot find ${DFU_UTIL} " >&2
19
+ exit 2
20
+ fi
21
+
22
+ # Pass all parameters through
23
+ " ${DFU_UTIL} " " $@ "
Original file line number Diff line number Diff line change @@ -26,18 +26,7 @@ DIR=$( cd "$( dirname "${BASH_SOURCE[0]}" )" && pwd )
26
26
27
27
" ${DIR} /upload-reset" ${dummy_port_fullpath} 750
28
28
29
- if [ ` uname -m` == " x86_64" ]; then
30
- DFU_UTIL=${DIR} /dfu-util_x86_64/dfu-util
31
- else
32
- DFU_UTIL=${DIR} /dfu-util/dfu-util
33
- fi
34
-
35
- if [ ! -x " ${DFU_UTIL} " ]; then
36
- echo " $0 : error: cannot find ${DFU_UTIL} " >&2
37
- exit 2
38
- fi
39
-
40
- " ${DFU_UTIL} " -d ${usbID} -a ${altID} -D ${binfile} ${dfuse_addr} -R
29
+ " ${DIR} /dfu-util.sh" -d ${usbID} -a ${altID} -D ${binfile} ${dfuse_addr} -R
41
30
42
31
echo -n Waiting for ${dummy_port_fullpath} serial...
43
32
You can’t perform that action at this time.
0 commit comments