diff options
Diffstat (limited to 'apps/main.c')
-rw-r--r-- | apps/main.c | 34 |
1 files changed, 29 insertions, 5 deletions
diff --git a/apps/main.c b/apps/main.c index ac84027362..572e0a3114 100644 --- a/apps/main.c +++ b/apps/main.c | |||
@@ -101,6 +101,9 @@ int main(void) | |||
101 | #ifdef CONFIG_TUNER | 101 | #ifdef CONFIG_TUNER |
102 | #include "radio.h" | 102 | #include "radio.h" |
103 | #endif | 103 | #endif |
104 | #ifdef HAVE_MMC | ||
105 | #include "ata_mmc.h" | ||
106 | #endif | ||
104 | 107 | ||
105 | /*#define AUTOROCK*/ /* define this to check for "autostart.rock" on boot */ | 108 | /*#define AUTOROCK*/ /* define this to check for "autostart.rock" on boot */ |
106 | 109 | ||
@@ -236,7 +239,8 @@ void init(void) | |||
236 | 239 | ||
237 | usb_start_monitoring(); | 240 | usb_start_monitoring(); |
238 | 241 | ||
239 | pinfo = disk_init(); | 242 | /* FixMe: the same kind of mounting happens in usb.c, share the code. */ |
243 | pinfo = disk_init(IF_MV(0)); | ||
240 | if (!pinfo) | 244 | if (!pinfo) |
241 | { | 245 | { |
242 | lcd_clear_display(); | 246 | lcd_clear_display(); |
@@ -252,14 +256,15 @@ void init(void) | |||
252 | system_reboot(); | 256 | system_reboot(); |
253 | } | 257 | } |
254 | 258 | ||
259 | fat_init(); | ||
255 | for ( i=0; i<4; i++ ) { | 260 | for ( i=0; i<4; i++ ) { |
256 | if (!fat_mount(pinfo[i].start)) | 261 | if (!fat_mount(IF_MV2(0,) IF_MV2(0,) pinfo[i].start)) |
257 | break; | 262 | break; /* only one partition gets mounted as of now */ |
258 | } | 263 | } |
259 | 264 | ||
260 | if ( i==4 ) { | 265 | if ( i==4 ) { |
261 | DEBUGF("No partition found, trying to mount sector 0.\n"); | 266 | DEBUGF("No partition found, trying to mount sector 0.\n"); |
262 | rc = fat_mount(0); | 267 | rc = fat_mount(IF_MV2(0,) IF_MV2(0,) 0); |
263 | if(rc) { | 268 | if(rc) { |
264 | lcd_clear_display(); | 269 | lcd_clear_display(); |
265 | lcd_puts(0,0,"No FAT32"); | 270 | lcd_puts(0,0,"No FAT32"); |
@@ -272,7 +277,26 @@ void init(void) | |||
272 | /* The USB thread will panic if the drive still can't be mounted */ | 277 | /* The USB thread will panic if the drive still can't be mounted */ |
273 | } | 278 | } |
274 | } | 279 | } |
275 | 280 | #ifdef HAVE_MULTIVOLUME | |
281 | /* mount partition on the optional volume */ | ||
282 | #ifdef HAVE_MMC | ||
283 | if (mmc_detect()) /* for Ondio, only if card detected */ | ||
284 | #endif | ||
285 | { | ||
286 | pinfo = disk_init(1); | ||
287 | if (pinfo) | ||
288 | { | ||
289 | for ( i=0; i<4; i++ ) { | ||
290 | if (!fat_mount(1, 1, pinfo[i].start)) | ||
291 | break; /* only one partition gets mounted as of now */ | ||
292 | } | ||
293 | |||
294 | if ( i==4 ) { | ||
295 | rc = fat_mount(1, 1, 0); | ||
296 | } | ||
297 | } | ||
298 | } | ||
299 | #endif /* #ifdef HAVE_MULTIVOLUME */ | ||
276 | settings_calc_config_sector(); | 300 | settings_calc_config_sector(); |
277 | settings_load(SETTINGS_ALL); | 301 | settings_load(SETTINGS_ALL); |
278 | settings_apply(); | 302 | settings_apply(); |