Skip to content

Commit

Permalink
tools/pyboard.py: Track raw REPL state via in_raw_repl variable.
Browse files Browse the repository at this point in the history
Signed-off-by: Damien George <[email protected]>
  • Loading branch information
dpgeorge committed May 29, 2021
1 parent db8704e commit 4982d09
Showing 1 changed file with 4 additions and 0 deletions.
4 changes: 4 additions & 0 deletions tools/pyboard.py
Original file line number Diff line number Diff line change
Expand Up @@ -255,6 +255,7 @@ class Pyboard:
def __init__(
self, device, baudrate=115200, user="micro", password="python", wait=0, exclusive=True
):
self.in_raw_repl = False
self.use_raw_paste = True
if device.startswith("exec:"):
self.serial = ProcessToSerial(device[len("exec:") :])
Expand Down Expand Up @@ -348,8 +349,11 @@ def enter_raw_repl(self):
print(data)
raise PyboardError("could not enter raw repl")

self.in_raw_repl = True

def exit_raw_repl(self):
self.serial.write(b"\r\x02") # ctrl-B: enter friendly REPL
self.in_raw_repl = False

def follow(self, timeout, data_consumer=None):
# wait for normal output
Expand Down

0 comments on commit 4982d09

Please sign in to comment.