summaryrefslogtreecommitdiffstatshomepage
diff options
context:
space:
mode:
authorDamien George <damien@micropython.org>2021-05-29 11:04:01 +1000
committerDamien George <damien@micropython.org>2021-05-29 17:17:22 +1000
commit4982d0920ebd247758aa6321bb36a5eede0bd775 (patch)
treeaeb5d666eaffa69241425bd7443bf6b1ae607c78
parentdb8704ecbd910e598fba4bc1817acf91d9da79e3 (diff)
downloadmicropython-4982d0920ebd247758aa6321bb36a5eede0bd775.tar.gz
micropython-4982d0920ebd247758aa6321bb36a5eede0bd775.zip
tools/pyboard.py: Track raw REPL state via in_raw_repl variable.
Signed-off-by: Damien George <damien@micropython.org>
-rwxr-xr-xtools/pyboard.py4
1 files changed, 4 insertions, 0 deletions
diff --git a/tools/pyboard.py b/tools/pyboard.py
index 29a15f7eae..220c010937 100755
--- a/tools/pyboard.py
+++ b/tools/pyboard.py
@@ -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:") :])
@@ -348,8 +349,11 @@ class Pyboard:
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