diff options
author | Andrew Leech <andrew.leech@planetinnovation.com.au> | 2022-02-01 11:59:59 +1100 |
---|---|---|
committer | Damien George <damien@micropython.org> | 2022-02-04 16:19:25 +1100 |
commit | 203ec8ca7fa5f59e20bca95c74a77e3b1e8ef394 (patch) | |
tree | 5a31569f6942a4c4d3e8db798d77a6a12596c1a5 | |
parent | b1519845f5dfd46b82fd5b3d980812d30ce0140b (diff) |
tools/mpremote: Correctly manage mounted flag during soft-reset.
-rw-r--r-- | tools/mpremote/mpremote/pyboardextended.py | 6 |
1 files changed, 5 insertions, 1 deletions
diff --git a/tools/mpremote/mpremote/pyboardextended.py b/tools/mpremote/mpremote/pyboardextended.py index 1b6463e85..2ec1fbbee 100644 --- a/tools/mpremote/mpremote/pyboardextended.py +++ b/tools/mpremote/mpremote/pyboardextended.py @@ -614,10 +614,10 @@ class PyboardExtended(Pyboard): def mount_local(self, path): fout = self.serial - self.mounted = True if self.eval('"RemoteFS" in globals()') == b"False": self.exec_(fs_hook_code) self.exec_("__mount()") + self.mounted = True self.cmd = PyboardCommand(self.serial, fout, path) self.serial = SerialIntercept(self.serial, self.cmd) @@ -626,6 +626,9 @@ class PyboardExtended(Pyboard): if not self.mounted: return + # Clear flag while board reboots, it will be re-set once mounted. + self.mounted = False + # Wait for a response to the soft-reset command. for i in range(10): if self.serial.inWaiting(): @@ -646,6 +649,7 @@ class PyboardExtended(Pyboard): self.serial.write(b"\x01") self.exec_(fs_hook_code) self.exec_("__mount()") + self.mounted = True self.exit_raw_repl() self.read_until(4, b">>> ") self.serial = SerialIntercept(self.serial, self.cmd) |