mirror of
git://projects.qi-hardware.com/antorcha.git
synced 2025-04-21 12:27:27 +03:00
tornado/fw/mmc.c (mmc_wait): return success or failure (timeout)
This commit is contained in:
@@ -76,16 +76,17 @@ static uint8_t mmc_r1(void)
|
||||
}
|
||||
|
||||
|
||||
static void mmc_wait(void)
|
||||
static bool mmc_wait(void)
|
||||
{
|
||||
uint8_t v, tries = 0xff;
|
||||
|
||||
do {
|
||||
v = mmc_recv();
|
||||
if (v == MMC_START_SINGLE_BLOCK)
|
||||
return;
|
||||
return 1;
|
||||
}
|
||||
while (--tries);
|
||||
return 0;
|
||||
}
|
||||
|
||||
|
||||
@@ -97,8 +98,7 @@ bool mmc_begin_read(uint32_t sector)
|
||||
mmc_end();
|
||||
return 0;
|
||||
} else {
|
||||
mmc_wait();
|
||||
return 1;
|
||||
return mmc_wait();
|
||||
}
|
||||
}
|
||||
|
||||
|
||||
Reference in New Issue
Block a user