Skip to content

Commit 437834a

Browse files
Added code by @danieleff to delay leaving the maple_upload script (in all platforms) until the Serial device has reconnected - this helps resolve the problem of needing to close the Arduino Serial Monitor prior to upload
1 parent c3d9d1b commit 437834a

File tree

4 files changed

+37
-0
lines changed

4 files changed

+37
-0
lines changed

tools/linux/maple_upload

Lines changed: 9 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -38,3 +38,12 @@ if [ ! -x "${DFU_UTIL}" ]; then
3838
fi
3939

4040
"${DFU_UTIL}" -d ${usbID} -a ${altID} -D ${binfile} ${dfuse_addr} -R
41+
42+
echo -n Waiting for ${dummy_port_fullpath} serial...
43+
44+
COUNTER=0
45+
while [ ! -c ${dummy_port_fullpath} ] && ((COUNTER++ < 40)); do
46+
sleep 0.1
47+
done
48+
49+
echo Done

tools/linux64/maple_upload

Lines changed: 9 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -38,3 +38,12 @@ if [ ! -x "${DFU_UTIL}" ]; then
3838
fi
3939

4040
"${DFU_UTIL}" -d ${usbID} -a ${altID} -D ${binfile} ${dfuse_addr} -R
41+
42+
echo -n Waiting for ${dummy_port_fullpath} serial...
43+
44+
COUNTER=0
45+
while [ ! -c ${dummy_port_fullpath} ] && ((COUNTER++ < 40)); do
46+
sleep 0.1
47+
done
48+
49+
echo Done

tools/macosx/maple_upload

Lines changed: 9 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -51,3 +51,12 @@ if [ ! -x ${DFU_UTIL} ]; then
5151
fi
5252

5353
${DFU_UTIL} -d ${usbID} -a ${altID} -D ${binfile} -R ${dfuse_addr} -R
54+
55+
echo -n Waiting for ${dummy_port_fullpath} serial...
56+
57+
COUNTER=0
58+
while [ ! -c ${dummy_port_fullpath} ] && ((COUNTER++ < 40)); do
59+
sleep 0.1
60+
done
61+
62+
echo Done

tools/win/maple_upload.bat

Lines changed: 10 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -6,3 +6,13 @@ set driverLetter=%driverLetter:~0,2%
66
%driverLetter%
77
cd %~dp0
88
java -jar maple_loader.jar %1 %2 %3 %4 %5 %6 %7 %8 %9
9+
10+
for /l %%x in (1, 1, 40) do (
11+
ping -w 50 -n 1 192.0.2.1 > nul
12+
mode %1 > nul
13+
if ERRORLEVEL 0 goto comPortFound
14+
)
15+
16+
echo timeout waiting for %1 serial
17+
18+
:comPortFound

0 commit comments

Comments
 (0)