-
Notifications
You must be signed in to change notification settings - Fork 1.3k
Fix to allow remount when usb enabled but not msc #2606
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
Conversation
This looks good to me! @bmeisels one question: Did you test this by powering the board by battery and having USB plugged in, and then disconnecting and attempting the |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Thank you for the PR! Unfortunately I think some of the TinyUSB terminology confused things a bit.
Instead of modifying usb.c, please modify usb_msc_flash.c instead. It is already tracking when the host "ejects" the drive. You'll need to set ejected to true on init and then exposed a similar function to check it from storage.
supervisor/shared/usb/usb.c
Outdated
@@ -87,11 +92,13 @@ void usb_background(void) { | |||
|
|||
// Invoked when device is mounted | |||
void tud_mount_cb(void) { | |||
g_usb_msc_enabled = true; |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
I don't think this needed. mount
doesn't mean filesystem mount here unfortunately. It is plugged/unplugged.
9f966dc
to
9df47d5
Compare
@tannewt @dhalbert i have edited the patch according to your suggestion.
I hope this is now correct |
I'd prefer |
9df47d5
to
07708f1
Compare
Implemented the requested changes. I did not retest on actual hardware. |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Thank you!
Addresses #2509.
storage remount now checks if USB MSC is mounted.
Would appreciate more testing before merging.