summaryrefslogtreecommitdiffstats
path: root/firmware
diff options
context:
space:
mode:
Diffstat (limited to 'firmware')
-rw-r--r--firmware/usbstack/usb_storage.c9
1 files changed, 6 insertions, 3 deletions
diff --git a/firmware/usbstack/usb_storage.c b/firmware/usbstack/usb_storage.c
index 1f7069dfe2..dfcd51b19e 100644
--- a/firmware/usbstack/usb_storage.c
+++ b/firmware/usbstack/usb_storage.c
@@ -306,10 +306,13 @@ void usb_storage_notify_hotswap(int volume,bool inserted)
void usb_storage_reconnect(void)
{
int i;
- for(i=0;i<NUM_VOLUMES;i++)
- ejected[i] = !check_disk_present(IF_MV(i));
+ if(usb_core_driver_enabled(USB_DRIVER_MASS_STORAGE)
+ && usb_inserted()) {
+ for(i=0;i<NUM_VOLUMES;i++)
+ ejected[i] = !check_disk_present(IF_MV(i));
- usb_request_exclusive_ata();
+ usb_request_exclusive_ata();
+ }
}
/* called by usb_code_init() */