summaryrefslogtreecommitdiff
path: root/firmware/usb.c
diff options
context:
space:
mode:
authorJörg Hohensohn <hohensoh@rockbox.org>2004-12-28 22:16:07 +0000
committerJörg Hohensohn <hohensoh@rockbox.org>2004-12-28 22:16:07 +0000
commitda848576312800dc229624e928d132d0702c1854 (patch)
tree38cd01b8a9c1069a1de734e0f7eb478436715573 /firmware/usb.c
parentae45d970d874217b779071b414dcd5edbf5647da (diff)
prepared to mount multiple partitions into one logical file system (most useful for Ondio, internal memory + external MMC)
git-svn-id: svn://svn.rockbox.org/rockbox/trunk@5514 a1c6a512-1295-4272-9138-f99709370657
Diffstat (limited to 'firmware/usb.c')
-rw-r--r--firmware/usb.c27
1 files changed, 24 insertions, 3 deletions
diff --git a/firmware/usb.c b/firmware/usb.c
index e27c003154..ab8e080c45 100644
--- a/firmware/usb.c
+++ b/firmware/usb.c
@@ -157,17 +157,38 @@ static void usb_slave_mode(bool on)
panicf("ata: %d",rc);
}
- pinfo = disk_init();
+ pinfo = disk_init(IF_MV(0));
if (!pinfo)
panicf("disk: NULL");
+ fat_init();
for ( i=0; i<4; i++ ) {
- rc = fat_mount(pinfo[i].start);
+ rc = fat_mount(IF_MV2(0,) IF_MV2(0,) pinfo[i].start);
if (!rc)
- break;
+ break; /* only one partition gets mounted as of now */
}
if (i==4)
panicf("mount: %d",rc);
+#ifdef HAVE_MULTIVOLUME
+ /* mount partition on the optional volume */
+#ifdef HAVE_MMC
+ if (mmc_detect()) /* for Ondio, only if card detected */
+#endif
+ {
+ pinfo = disk_init(1);
+ if (pinfo)
+ {
+ for ( i=0; i<4; i++ ) {
+ if (!fat_mount(1, 1, pinfo[i].start))
+ break; /* only one partition gets mounted as of now */
+ }
+
+ if ( i==4 ) {
+ rc = fat_mount(1, 1, 0);
+ }
+ }
+ }
+#endif /* #ifdef HAVE_MULTIVOLUME */
}
}