Skip to content

Commit c0c0f9b

Browse files
committed
[maple_upload] Use dfu-util.sh on macosx
1 parent acb6d26 commit c0c0f9b

File tree

2 files changed

+19
-12
lines changed

2 files changed

+19
-12
lines changed

macosx/dfu-util.sh

+18
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,18 @@
1+
#!/bin/bash
2+
3+
# Get the directory where the script is running.
4+
DIR=$(cd "$(dirname "${BASH_SOURCE[0]}")" && pwd)
5+
6+
DFU_UTIL=${DIR}/dfu-util/dfu-util
7+
if [ ! -x "${DFU_UTIL}" ]; then
8+
DFU_UTIL=/opt/local/bin/dfu-util
9+
fi
10+
11+
# Not found!
12+
if [ ! -x "${DFU_UTIL}" ]; then
13+
echo "$0: error: cannot find ${DFU_UTIL}" >&2
14+
exit 2
15+
fi
16+
17+
# Pass all parameters through
18+
"${DFU_UTIL}" "$@"

macosx/maple_upload.sh

+1-12
Original file line numberDiff line numberDiff line change
@@ -40,18 +40,7 @@ else
4040
dfuse_addr=""
4141
fi
4242

43-
#DFU_UTIL=/usr/local/bin/dfu-util
44-
DFU_UTIL=${DIR}/dfu-util/dfu-util
45-
if [ ! -x "${DFU_UTIL}" ]; then
46-
DFU_UTIL=/opt/local/bin/dfu-util
47-
fi
48-
49-
if [ ! -x ${DFU_UTIL} ]; then
50-
echo "$0: error: cannot find ${DFU_UTIL}" >&2
51-
exit 2
52-
fi
53-
54-
${DFU_UTIL} -d "${usbID}" -a "${altID}" -D "${binfile}" -R ${dfuse_addr} -R
43+
"${DIR}/dfu-util.sh" -d "${usbID}" -a "${altID}" -D "${binfile}" -R ${dfuse_addr} -R
5544

5645
echo -n Waiting for "${dummy_port_fullpath}" serial...
5746

0 commit comments

Comments
 (0)