summaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorFrank Gevaerts <frank@gevaerts.be>2008-04-13 17:16:50 +0000
committerFrank Gevaerts <frank@gevaerts.be>2008-04-13 17:16:50 +0000
commitbe77cf5279da938de8b120665fe00c9124490df5 (patch)
tree09e7ec168233f91878138caf24312b455a8ce02e
parentb90a766d0195154170b693f030f044366a15ee2c (diff)
downloadrockbox-be77cf5279da938de8b120665fe00c9124490df5.tar.gz
rockbox-be77cf5279da938de8b120665fe00c9124490df5.tar.bz2
rockbox-be77cf5279da938de8b120665fe00c9124490df5.zip
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
-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() */