diff options
author | Frank Gevaerts <frank@gevaerts.be> | 2008-04-13 17:16:50 +0000 |
---|---|---|
committer | Frank Gevaerts <frank@gevaerts.be> | 2008-04-13 17:16:50 +0000 |
commit | be77cf5279da938de8b120665fe00c9124490df5 (patch) | |
tree | 09e7ec168233f91878138caf24312b455a8ce02e /firmware/usbstack/usb_storage.c | |
parent | b90a766d0195154170b693f030f044366a15ee2c (diff) |
only reconnect mass storage if there is actually an active usb connection, with mass storage enabled
git-svn-id: svn://svn.rockbox.org/rockbox/trunk@17098 a1c6a512-1295-4272-9138-f99709370657
Diffstat (limited to 'firmware/usbstack/usb_storage.c')
-rw-r--r-- | firmware/usbstack/usb_storage.c | 9 |
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() */ |