Skip to content

Get CIRCUITPY FATFS directly. #6695

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

Merged
merged 1 commit into from
Aug 5, 2022
Merged

Conversation

tannewt
Copy link
Member

@tannewt tannewt commented Aug 4, 2022

Otherwise, you may actually get a non-root filesystem.

Fixes #6575

Otherwise, you may actually get a non-root filesystem.

Fixes micropython#6575
@tannewt tannewt requested a review from dhalbert August 4, 2022 23:09
Copy link
Collaborator

@dhalbert dhalbert left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Looks great, it's clearer, and probably reduces code size!

@@ -199,5 +201,12 @@ void filesystem_set_concurrent_write_protection(fs_user_mount_t *vfs, bool concu
}

bool filesystem_present(void) {
return true;
Copy link

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

It's a very unlikely scenario but a device could have damaged flash but someone mounts an sd filesystem via the repl. This would make this function return true but the internal filesystem object would be invalid.

The rest of the PR is great though and this is an unlikely story so don't let this alone stop it being merged

Copy link
Collaborator

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

@tannewt is it worth checking for this? Right now you go into safe mode if filesystem_init() fails for CIRCUITPY.

Copy link
Collaborator

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

I think I will merge anyway to get this in and an issue could be opened if it's worth it.

Copy link
Member Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

_mp_vfs.len isn't the length of vfs mounts. It's the length of the mount point string for the "native" filesystems vfs entry. So I think it'll be ok even when only an SD card exists.

@dhalbert dhalbert merged commit 7ab8a66 into adafruit:main Aug 5, 2022
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

Web Workflow: After mounting an SD card the web workflow "file browser" displays the SD card contents
3 participants