From 5a0e9945e6efeebf29a4a63f0424eaed62d02a17 Mon Sep 17 00:00:00 2001 From: Jeff Epler Date: Mon, 22 Mar 2021 11:45:29 -0500 Subject: [PATCH 1/2] storage: Correct when we check for USB mounts Closes #4417 --- shared-module/storage/__init__.c | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/shared-module/storage/__init__.c b/shared-module/storage/__init__.c index db994158d6..5c743377df 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.")); } From 904e94abeb6f5a94f26d4467ce8f69ba00b727e8 Mon Sep 17 00:00:00 2001 From: Jeff Epler Date: Mon, 22 Mar 2021 15:04:57 -0500 Subject: [PATCH 2/2] make declatations of usb_msc_ routines conditional .. as suggested by @dhalbert --- supervisor/usb.h | 2 ++ 1 file changed, 2 insertions(+) diff --git a/supervisor/usb.h b/supervisor/usb.h index 1c709926a7..f8fd713715 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