diff options
author | Damien George <damien.p.george@gmail.com> | 2015-07-25 22:46:07 +0100 |
---|---|---|
committer | Damien George <damien.p.george@gmail.com> | 2015-07-25 22:46:07 +0100 |
commit | f1236734bbd8baaa2566e0f3abdd0ff2d6663932 (patch) | |
tree | 3fa4f1addcc92be059fd0ab24f1ffdc74f549eb1 /tools/pyboard.py | |
parent | 9de53bf788e6f878396f6b796d39f21c058f3f16 (diff) | |
download | micropython-f1236734bbd8baaa2566e0f3abdd0ff2d6663932.tar.gz micropython-f1236734bbd8baaa2566e0f3abdd0ff2d6663932.zip |
tools/pyboard.py: Make enter_raw_repl stricter and more reliable.
When looking for chars to indicate raw repl is active, look for the full
string of chars to improve reliability of entering raw repl correctly.
Previous to this patch there was the possibility that raw repl was
entered in a dirty state, where not all input chars from previous
invocation were drained.
Diffstat (limited to 'tools/pyboard.py')
-rwxr-xr-x | tools/pyboard.py | 6 |
1 files changed, 3 insertions, 3 deletions
diff --git a/tools/pyboard.py b/tools/pyboard.py index fec30e1592..4032202402 100755 --- a/tools/pyboard.py +++ b/tools/pyboard.py @@ -79,14 +79,14 @@ class Pyboard: n = self.serial.inWaiting() self.serial.write(b'\r\x01') # ctrl-A: enter raw REPL - data = self.read_until(1, b'to exit\r\n>') + 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') self.serial.write(b'\x04') # ctrl-D: soft reset - data = self.read_until(1, b'to exit\r\n') - if not data.endswith(b'raw REPL; CTRL-B to exit\r\n'): + data = self.read_until(1, b'soft reboot\r\nraw REPL; CTRL-B to exit\r\n') + if not data.endswith(b'soft reboot\r\nraw REPL; CTRL-B to exit\r\n'): print(data) raise PyboardError('could not enter raw repl') |