Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Should add checks for boot_out.txt #2263

Open
wants to merge 1 commit into
base: master
Choose a base branch
from
Open
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
9 changes: 7 additions & 2 deletions mu/modes/circuitpython.py
Original file line number Diff line number Diff line change
Expand Up @@ -173,9 +173,10 @@ def workspace_dir(self):
mounted_volumes = [x.split()[2] for x in mount_output]
for volume in mounted_volumes:
tail = os.path.split(volume)[-1]
boot_out_path = "{}boot_out.txt".format(volume)
if tail.startswith(b"CIRCUITPY") or tail.startswith(
b"PYBFLASH"
):
) or os.path.exists(boot_out_path):
device_dir = volume.decode("utf-8")
break
except FileNotFoundError:
Expand Down Expand Up @@ -246,9 +247,13 @@ def get_volume_name(disk_name):
try:
for disk in "ABCDEFGHIJKLMNOPQRSTUVWXYZ":
path = "{}:\\".format(disk)
boot_out_path = "{}:\\boot_out.txt".format(disk)
if (
os.path.exists(path)
and get_volume_name(path) == "CIRCUITPY"
and (
get_volume_name(path) == "CIRCUITPY"
or os.path.exists(boot_out_path)
)
):
return path
finally:
Expand Down