Skip to content

Commit f123673

Browse files
committed
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.
1 parent 9de53bf commit f123673

File tree

1 file changed

+3
-3
lines changed

1 file changed

+3
-3
lines changed

tools/pyboard.py

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -79,14 +79,14 @@ def enter_raw_repl(self):
7979
n = self.serial.inWaiting()
8080

8181
self.serial.write(b'\r\x01') # ctrl-A: enter raw REPL
82-
data = self.read_until(1, b'to exit\r\n>')
82+
data = self.read_until(1, b'raw REPL; CTRL-B to exit\r\n>')
8383
if not data.endswith(b'raw REPL; CTRL-B to exit\r\n>'):
8484
print(data)
8585
raise PyboardError('could not enter raw repl')
8686

8787
self.serial.write(b'\x04') # ctrl-D: soft reset
88-
data = self.read_until(1, b'to exit\r\n')
89-
if not data.endswith(b'raw REPL; CTRL-B to exit\r\n'):
88+
data = self.read_until(1, b'soft reboot\r\nraw REPL; CTRL-B to exit\r\n')
89+
if not data.endswith(b'soft reboot\r\nraw REPL; CTRL-B to exit\r\n'):
9090
print(data)
9191
raise PyboardError('could not enter raw repl')
9292

0 commit comments

Comments
 (0)