Commit 519cef81 authored by Dave Hylands's avatar Dave Hylands Committed by Damien George
Browse files

tools: Allow pyboard.py to work when boot.py prints things.

parent cbc489df
...@@ -165,8 +165,14 @@ class Pyboard: ...@@ -165,8 +165,14 @@ class Pyboard:
raise PyboardError('could not enter raw repl') raise PyboardError('could not enter raw repl')
self.serial.write(b'\x04') # ctrl-D: soft reset self.serial.write(b'\x04') # ctrl-D: soft reset
data = self.read_until(1, b'soft reboot\r\nraw 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\nraw REPL; CTRL-B to exit\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) print(data)
raise PyboardError('could not enter raw repl') raise PyboardError('could not enter raw repl')
......
Supports Markdown
0% or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment