Merge pull request #4462 from jepler/disable-usb-cdc

storage: Correct when we check for USB mounts
This commit is contained in:
Scott Shawcroft 2021-03-22 15:52:10 -07:00 committed by GitHub
commit d52662856b
No known key found for this signature in database
GPG Key ID: 4AEE18F83AFDEB23
2 changed files with 3 additions and 1 deletions

View File

@ -149,7 +149,7 @@ void common_hal_storage_remount(const char *mount_path, bool readonly, bool disa
mp_raise_OSError(MP_EINVAL);
}
#ifdef USB_AVAILABLE
#if CIRCUITPY_USB_MSC
if (!usb_msc_ejected()) {
mp_raise_RuntimeError(translate("Cannot remount '/' when USB is active."));
}

View File

@ -54,8 +54,10 @@ void usb_init(void);
void usb_disconnect(void);
// Propagate plug/unplug events to the MSC logic.
#if CIRCUITPY_USB_MSC
void usb_msc_mount(void);
void usb_msc_umount(void);
bool usb_msc_ejected(void);
#endif
#endif // MICROPY_INCLUDED_SUPERVISOR_USB_H