forked from len0rd/rockbox
(1) Early USB detection on boot, before trying to mount the partitions. Cleaner & quicker; removes the need for the extra USB check at the top of ask_resume() which caused a deadlock in screenshot mode (see patch #1110332). On Ondio, this allows to leave an MMC in the slot when booting with USB connected for instant access. (2) Ondio: Track MMC status, only ask to remove the card if required. Probe MMC status if unknown.
git-svn-id: svn://svn.rockbox.org/rockbox/trunk@6488 a1c6a512-1295-4272-9138-f99709370657
This commit is contained in:
parent
32be590e6d
commit
27abc2a641
6 changed files with 64 additions and 21 deletions
44
apps/main.c
44
apps/main.c
|
@ -127,6 +127,7 @@ void init(void)
|
|||
void init(void)
|
||||
{
|
||||
int rc;
|
||||
bool mounted = false;
|
||||
#if defined(HAVE_CHARGING) && (CONFIG_CPU == SH7034)
|
||||
/* if nobody initialized ATA before, I consider this a cold start */
|
||||
bool coldstart = (PACR2 & 0x4000) != 0; /* starting from Flash */
|
||||
|
@ -216,22 +217,35 @@ void init(void)
|
|||
}
|
||||
|
||||
usb_start_monitoring();
|
||||
|
||||
/* FixMe: the same kind of mounting happens in usb.c, share the code. */
|
||||
rc = disk_mount_all();
|
||||
if (rc<=0)
|
||||
{
|
||||
lcd_clear_display();
|
||||
lcd_puts(0, 0, "No partition");
|
||||
lcd_puts(0, 1, "found.");
|
||||
#ifdef HAVE_LCD_BITMAP
|
||||
lcd_puts(0, 2, "Insert USB cable");
|
||||
lcd_puts(0, 3, "and fix it.");
|
||||
lcd_update();
|
||||
while (usb_detect())
|
||||
{ /* enter USB mode early, before trying to mount */
|
||||
if (button_get_w_tmo(HZ/10) == SYS_USB_CONNECTED)
|
||||
#ifdef HAVE_MMC
|
||||
if (!mmc_touched() || (mmc_remove_request() == SYS_MMC_EXTRACTED))
|
||||
#endif
|
||||
while(button_get(true) != SYS_USB_CONNECTED) {};
|
||||
usb_screen();
|
||||
system_reboot();
|
||||
{
|
||||
usb_screen();
|
||||
mounted = true; /* mounting done @ end of USB mode */
|
||||
}
|
||||
}
|
||||
|
||||
if (!mounted)
|
||||
{
|
||||
rc = disk_mount_all();
|
||||
if (rc<=0)
|
||||
{
|
||||
lcd_clear_display();
|
||||
lcd_puts(0, 0, "No partition");
|
||||
lcd_puts(0, 1, "found.");
|
||||
#ifdef HAVE_LCD_BITMAP
|
||||
lcd_puts(0, 2, "Insert USB cable");
|
||||
lcd_puts(0, 3, "and fix it.");
|
||||
lcd_update();
|
||||
#endif
|
||||
while(button_get(true) != SYS_USB_CONNECTED) {};
|
||||
usb_screen();
|
||||
system_reboot();
|
||||
}
|
||||
}
|
||||
|
||||
settings_calc_config_sector();
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue