diff --git a/shared-module/storage/__init__.c b/shared-module/storage/__init__.c index db994158d6489..5c743377df74b 100644 --- a/shared-module/storage/__init__.c +++ b/shared-module/storage/__init__.c @@ -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.")); } diff --git a/supervisor/usb.h b/supervisor/usb.h index 1c709926a7118..f8fd713715f1c 100644 --- a/supervisor/usb.h +++ b/supervisor/usb.h @@ -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