summaryrefslogtreecommitdiffstats
path: root/firmware
diff options
context:
space:
mode:
authorJens Arnold <amiconn@rockbox.org>2005-05-16 15:21:09 +0000
committerJens Arnold <amiconn@rockbox.org>2005-05-16 15:21:09 +0000
commitfe1ce9d8426899d4c254a161955762a33e6fcf25 (patch)
treeea37ca25bd2fce8dc67766dfe4bba1cebe3f629a /firmware
parent15d7077c3ad2b7e3bcacf61a04428784b11e418c (diff)
downloadrockbox-fe1ce9d8426899d4c254a161955762a33e6fcf25.tar.gz
rockbox-fe1ce9d8426899d4c254a161955762a33e6fcf25.zip
Hotswap: Better placement for switching the MMC monitor off/on.
git-svn-id: svn://svn.rockbox.org/rockbox/trunk@6480 a1c6a512-1295-4272-9138-f99709370657
Diffstat (limited to 'firmware')
-rw-r--r--firmware/common/disk.c7
-rw-r--r--firmware/drivers/ata_mmc.c2
-rw-r--r--firmware/usb.c6
3 files changed, 8 insertions, 7 deletions
diff --git a/firmware/common/disk.c b/firmware/common/disk.c
index f4d153c1c2..2f1d789738 100644
--- a/firmware/common/disk.c
+++ b/firmware/common/disk.c
@@ -100,6 +100,10 @@ int disk_mount_all(void)
{
int mounted;
int i;
+
+#if defined(HAVE_MMC) && defined(HAVE_HOTSWAP)
+ mmc_enable_monitoring(false);
+#endif
fat_init(); /* reset all mounted partitions */
for (i=0; i<NUM_VOLUMES; i++)
@@ -111,6 +115,9 @@ int disk_mount_all(void)
{
mounted += disk_mount(1); /* try 2nd "drive", too */
}
+#ifdef HAVE_HOTSWAP
+ mmc_enable_monitoring(true);
+#endif
#endif
return mounted;
diff --git a/firmware/drivers/ata_mmc.c b/firmware/drivers/ata_mmc.c
index aa333dba32..9c2e5817f9 100644
--- a/firmware/drivers/ata_mmc.c
+++ b/firmware/drivers/ata_mmc.c
@@ -94,7 +94,7 @@ static struct mutex mmc_mutex;
static long mmc_stack[(DEFAULT_STACK_SIZE + 0x800)/sizeof(long)];
static const char mmc_thread_name[] = "mmc";
static struct event_queue mmc_queue;
-static bool mmc_monitor_enabled = false;
+static bool mmc_monitor_enabled = true;
#endif
static bool initialized = false;
static bool new_mmc_circuit;
diff --git a/firmware/usb.c b/firmware/usb.c
index 4b76fe60be..6095bcd65e 100644
--- a/firmware/usb.c
+++ b/firmware/usb.c
@@ -194,13 +194,7 @@ static void usb_slave_mode(bool on)
panicf("ata: %d",rc);
}
-#if defined(HAVE_MMC) && defined(HAVE_HOTSWAP)
- mmc_enable_monitoring(false);
rc = disk_mount_all();
- mmc_enable_monitoring(true);
-#else
- rc = disk_mount_all();
-#endif
if (rc <= 0) /* no partition */
panicf("mount: %d",rc);