Skip to content
GitLab
Menu
Projects
Groups
Snippets
/
Help
Help
Support
Community forum
Keyboard shortcuts
?
Submit feedback
Sign in
Toggle navigation
Menu
Open sidebar
TASTE
uPython-mirror
Commits
519cef81
Commit
519cef81
authored
Dec 03, 2015
by
Dave Hylands
Committed by
Damien George
Dec 06, 2015
Browse files
tools: Allow pyboard.py to work when boot.py prints things.
parent
cbc489df
Changes
1
Hide whitespace changes
Inline
Side-by-side
tools/pyboard.py
View file @
519cef81
...
...
@@ -165,8 +165,14 @@ class Pyboard:
raise
PyboardError
(
'could not enter raw repl'
)
self
.
serial
.
write
(
b
'
\x04
'
)
# ctrl-D: soft reset
data
=
self
.
read_until
(
1
,
b
'soft reboot
\r\n
raw REPL; CTRL-B to exit
\r\n
'
)
if
not
data
.
endswith
(
b
'soft reboot
\r\n
raw REPL; CTRL-B to exit
\r\n
'
):
data
=
self
.
read_until
(
1
,
b
'soft reboot
\r\n
'
)
if
not
data
.
endswith
(
b
'soft reboot
\r\n
'
):
print
(
data
)
raise
PyboardError
(
'could not enter raw repl'
)
# By splitting this into 2 reads, it allows boot.py to print stuff,
# which will show up after the soft reboot and before the raw REPL.
data
=
self
.
read_until
(
1
,
b
'raw REPL; CTRL-B to exit
\r\n
'
)
if
not
data
.
endswith
(
b
'raw REPL; CTRL-B to exit
\r\n
'
):
print
(
data
)
raise
PyboardError
(
'could not enter raw repl'
)
...
...
Write
Preview
Supports
Markdown
0%
Try again
or
attach a new file
.
Attach a file
Cancel
You are about to add
0
people
to the discussion. Proceed with caution.
Finish editing this message first!
Cancel
Please
register
or
sign in
to comment