diff options
-rw-r--r-- | apps/main.c | 17 | ||||
-rw-r--r-- | firmware/common/disk.h | 2 |
2 files changed, 14 insertions, 5 deletions
diff --git a/apps/main.c b/apps/main.c index 2062efa347..36a3f4e71d 100644 --- a/apps/main.c +++ b/apps/main.c | |||
@@ -76,7 +76,7 @@ extern int poolend[]; | |||
76 | 76 | ||
77 | void init(void) | 77 | void init(void) |
78 | { | 78 | { |
79 | int rc; | 79 | int rc, i; |
80 | struct partinfo* pinfo; | 80 | struct partinfo* pinfo; |
81 | 81 | ||
82 | system_init(); | 82 | system_init(); |
@@ -124,10 +124,17 @@ void init(void) | |||
124 | pinfo = disk_init(); | 124 | pinfo = disk_init(); |
125 | if (!pinfo) | 125 | if (!pinfo) |
126 | panicf("disk: NULL"); | 126 | panicf("disk: NULL"); |
127 | 127 | ||
128 | rc = fat_mount(pinfo[0].start); | 128 | for ( i=0; i<4; i++ ) { |
129 | if(rc) | 129 | if ( pinfo[i].type == PARTITION_TYPE_FAT32 ) { |
130 | panicf("mount: %d",rc); | 130 | rc = fat_mount(pinfo[i].start); |
131 | if(rc) | ||
132 | panicf("mount: %d",rc); | ||
133 | } | ||
134 | } | ||
135 | if ( i==4 ) { | ||
136 | panicf("No FAT32 partition!"); | ||
137 | } | ||
131 | 138 | ||
132 | settings_load(); | 139 | settings_load(); |
133 | global_settings.total_boots++; | 140 | global_settings.total_boots++; |
diff --git a/firmware/common/disk.h b/firmware/common/disk.h index 8a78386c6c..d8e1bc5ddd 100644 --- a/firmware/common/disk.h +++ b/firmware/common/disk.h | |||
@@ -25,6 +25,8 @@ struct partinfo { | |||
25 | unsigned char type; | 25 | unsigned char type; |
26 | }; | 26 | }; |
27 | 27 | ||
28 | #define PARTITION_TYPE_FAT32 0x0c | ||
29 | |||
28 | /* returns a pointer to an array of 8 partinfo structs */ | 30 | /* returns a pointer to an array of 8 partinfo structs */ |
29 | struct partinfo* disk_init(void); | 31 | struct partinfo* disk_init(void); |
30 | 32 | ||