summaryrefslogtreecommitdiff
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
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
-rw-r--r--apps/main.c3
-rw-r--r--firmware/common/disk.c7
-rw-r--r--firmware/drivers/ata_mmc.c2
-rw-r--r--firmware/usb.c6
4 files changed, 8 insertions, 10 deletions
diff --git a/apps/main.c b/apps/main.c
index edcff92995..25bc9296e5 100644
--- a/apps/main.c
+++ b/apps/main.c
@@ -233,9 +233,6 @@ void init(void)
233 usb_screen(); 233 usb_screen();
234 system_reboot(); 234 system_reboot();
235 } 235 }
236#if defined(HAVE_MMC) && defined(HAVE_HOTSWAP)
237 mmc_enable_monitoring(true);
238#endif
239 236
240 settings_calc_config_sector(); 237 settings_calc_config_sector();
241 settings_load(SETTINGS_ALL); 238 settings_load(SETTINGS_ALL);
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)
100{ 100{
101 int mounted; 101 int mounted;
102 int i; 102 int i;
103
104#if defined(HAVE_MMC) && defined(HAVE_HOTSWAP)
105 mmc_enable_monitoring(false);
106#endif
103 107
104 fat_init(); /* reset all mounted partitions */ 108 fat_init(); /* reset all mounted partitions */
105 for (i=0; i<NUM_VOLUMES; i++) 109 for (i=0; i<NUM_VOLUMES; i++)
@@ -111,6 +115,9 @@ int disk_mount_all(void)
111 { 115 {
112 mounted += disk_mount(1); /* try 2nd "drive", too */ 116 mounted += disk_mount(1); /* try 2nd "drive", too */
113 } 117 }
118#ifdef HAVE_HOTSWAP
119 mmc_enable_monitoring(true);
120#endif
114#endif 121#endif
115 122
116 return mounted; 123 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;
94static long mmc_stack[(DEFAULT_STACK_SIZE + 0x800)/sizeof(long)]; 94static long mmc_stack[(DEFAULT_STACK_SIZE + 0x800)/sizeof(long)];
95static const char mmc_thread_name[] = "mmc"; 95static const char mmc_thread_name[] = "mmc";
96static struct event_queue mmc_queue; 96static struct event_queue mmc_queue;
97static bool mmc_monitor_enabled = false; 97static bool mmc_monitor_enabled = true;
98#endif 98#endif
99static bool initialized = false; 99static bool initialized = false;
100static bool new_mmc_circuit; 100static 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)
194 panicf("ata: %d",rc); 194 panicf("ata: %d",rc);
195 } 195 }
196 196
197#if defined(HAVE_MMC) && defined(HAVE_HOTSWAP)
198 mmc_enable_monitoring(false);
199 rc = disk_mount_all(); 197 rc = disk_mount_all();
200 mmc_enable_monitoring(true);
201#else
202 rc = disk_mount_all();
203#endif
204 if (rc <= 0) /* no partition */ 198 if (rc <= 0) /* no partition */
205 panicf("mount: %d",rc); 199 panicf("mount: %d",rc);
206 200