forked from len0rd/rockbox
Added searching for FAT32 partition
git-svn-id: svn://svn.rockbox.org/rockbox/trunk@1351 a1c6a512-1295-4272-9138-f99709370657
This commit is contained in:
parent
f27cf011f7
commit
de943a5bd1
2 changed files with 14 additions and 5 deletions
17
apps/main.c
17
apps/main.c
|
@ -76,7 +76,7 @@ extern int poolend[];
|
||||||
|
|
||||||
void init(void)
|
void init(void)
|
||||||
{
|
{
|
||||||
int rc;
|
int rc, i;
|
||||||
struct partinfo* pinfo;
|
struct partinfo* pinfo;
|
||||||
|
|
||||||
system_init();
|
system_init();
|
||||||
|
@ -124,10 +124,17 @@ void init(void)
|
||||||
pinfo = disk_init();
|
pinfo = disk_init();
|
||||||
if (!pinfo)
|
if (!pinfo)
|
||||||
panicf("disk: NULL");
|
panicf("disk: NULL");
|
||||||
|
|
||||||
rc = fat_mount(pinfo[0].start);
|
for ( i=0; i<4; i++ ) {
|
||||||
if(rc)
|
if ( pinfo[i].type == PARTITION_TYPE_FAT32 ) {
|
||||||
panicf("mount: %d",rc);
|
rc = fat_mount(pinfo[i].start);
|
||||||
|
if(rc)
|
||||||
|
panicf("mount: %d",rc);
|
||||||
|
}
|
||||||
|
}
|
||||||
|
if ( i==4 ) {
|
||||||
|
panicf("No FAT32 partition!");
|
||||||
|
}
|
||||||
|
|
||||||
settings_load();
|
settings_load();
|
||||||
global_settings.total_boots++;
|
global_settings.total_boots++;
|
||||||
|
|
|
@ -25,6 +25,8 @@ struct partinfo {
|
||||||
unsigned char type;
|
unsigned char type;
|
||||||
};
|
};
|
||||||
|
|
||||||
|
#define PARTITION_TYPE_FAT32 0x0c
|
||||||
|
|
||||||
/* returns a pointer to an array of 8 partinfo structs */
|
/* returns a pointer to an array of 8 partinfo structs */
|
||||||
struct partinfo* disk_init(void);
|
struct partinfo* disk_init(void);
|
||||||
|
|
||||||
|
|
Loading…
Add table
Add a link
Reference in a new issue