Make sd_present() and mmc_present() look only at the actual presence of a card, not at initialisation state
git-svn-id: svn://svn.rockbox.org/rockbox/trunk@21981 a1c6a512-1295-4272-9138-f99709370657
This commit is contained in:
parent
3e1b9d5fdd
commit
a7548d3bc7
5 changed files with 29 additions and 9 deletions
|
@ -999,7 +999,14 @@ bool mmc_present(IF_MD_NONVOID(int drive))
|
||||||
#ifndef HAVE_MULTIDRIVE
|
#ifndef HAVE_MULTIDRIVE
|
||||||
const int drive=0;
|
const int drive=0;
|
||||||
#endif
|
#endif
|
||||||
return (card_info[drive].initialized && card_info[drive].numblocks > 0);
|
if(drive==0)
|
||||||
|
{
|
||||||
|
return true;
|
||||||
|
}
|
||||||
|
else
|
||||||
|
{
|
||||||
|
return mmc_detect();
|
||||||
|
}
|
||||||
}
|
}
|
||||||
#endif
|
#endif
|
||||||
|
|
||||||
|
|
|
@ -522,7 +522,14 @@ bool sd_present(IF_MD_NONVOID(int drive))
|
||||||
#ifndef HAVE_MULTIDRIVE
|
#ifndef HAVE_MULTIDRIVE
|
||||||
const int drive=0;
|
const int drive=0;
|
||||||
#endif
|
#endif
|
||||||
return (card_info[drive].initialized && card_info[drive].numblocks > 0);
|
if(drive==0)
|
||||||
|
{
|
||||||
|
return true;
|
||||||
|
}
|
||||||
|
else
|
||||||
|
{
|
||||||
|
return card_detect_target();
|
||||||
|
}
|
||||||
}
|
}
|
||||||
#endif
|
#endif
|
||||||
|
|
||||||
|
|
|
@ -1345,7 +1345,14 @@ bool sd_present(IF_MD_NONVOID(int drive))
|
||||||
#ifndef HAVE_MULTIDRIVE
|
#ifndef HAVE_MULTIDRIVE
|
||||||
const int drive=0;
|
const int drive=0;
|
||||||
#endif
|
#endif
|
||||||
return (card_info[drive].initialized && card_info[drive].numblocks > 0);
|
if(drive==0)
|
||||||
|
{
|
||||||
|
return true;
|
||||||
|
}
|
||||||
|
else
|
||||||
|
{
|
||||||
|
return card_detect_target();
|
||||||
|
}
|
||||||
}
|
}
|
||||||
#endif
|
#endif
|
||||||
|
|
||||||
|
|
|
@ -252,11 +252,10 @@ bool sd_removable(IF_MD_NONVOID(int card_no))
|
||||||
|
|
||||||
bool sd_present(IF_MD_NONVOID(int card_no))
|
bool sd_present(IF_MD_NONVOID(int card_no))
|
||||||
{
|
{
|
||||||
#ifndef HAVE_MULTIDRIVE
|
#ifdef HAVE_MULTIDRIVE
|
||||||
const int card_no = 0;
|
(void)card_no;
|
||||||
#endif
|
#endif
|
||||||
return (card_info[card_no].initialized &&
|
return card_detect_target();
|
||||||
card_info[card_no].numblocks > 0);
|
|
||||||
}
|
}
|
||||||
|
|
||||||
#else
|
#else
|
||||||
|
|
|
@ -1366,10 +1366,10 @@ bool sd_removable(IF_MV_NONVOID(int drive))
|
||||||
|
|
||||||
bool sd_present(IF_MV_NONVOID(int drive))
|
bool sd_present(IF_MV_NONVOID(int drive))
|
||||||
{
|
{
|
||||||
#ifdef HAVE_MULTIVOLUME
|
#ifdef HAVE_MULTIDRIVE
|
||||||
(void)drive;
|
(void)drive;
|
||||||
#endif
|
#endif
|
||||||
return (card.numblocks > 0 && card_detect_target());
|
return card_detect_target();
|
||||||
}
|
}
|
||||||
|
|
||||||
#ifdef CONFIG_STORAGE_MULTI
|
#ifdef CONFIG_STORAGE_MULTI
|
||||||
|
|
Loading…
Reference in a new issue