Add seconds timer + bugfixes
This commit is contained in:
12
ipl/sdmmc.c
12
ipl/sdmmc.c
@@ -228,7 +228,7 @@ static int _mmc_storage_get_op_cond_inner(sdmmc_storage_t *storage, u32 *pout, u
|
||||
|
||||
static int _mmc_storage_get_op_cond(sdmmc_storage_t *storage, u32 power)
|
||||
{
|
||||
u32 timeout = get_tmr() + 1500000;
|
||||
u32 timeout = get_tmr_us() + 1500000;
|
||||
|
||||
while (1)
|
||||
{
|
||||
@@ -241,7 +241,7 @@ static int _mmc_storage_get_op_cond(sdmmc_storage_t *storage, u32 power)
|
||||
storage->has_sector_access = 1;
|
||||
return 1;
|
||||
}
|
||||
if (get_tmr() > timeout)
|
||||
if (get_tmr_us() > timeout)
|
||||
break;
|
||||
sleep(1000);
|
||||
}
|
||||
@@ -605,7 +605,7 @@ static int _sd_storage_get_op_cond_once(sdmmc_storage_t *storage, u32 *cond, int
|
||||
|
||||
static int _sd_storage_get_op_cond(sdmmc_storage_t *storage, int is_version_1, int supports_low_voltage)
|
||||
{
|
||||
u32 timeout = get_tmr() + 1500000;
|
||||
u32 timeout = get_tmr_us() + 1500000;
|
||||
|
||||
while (1)
|
||||
{
|
||||
@@ -633,7 +633,7 @@ static int _sd_storage_get_op_cond(sdmmc_storage_t *storage, int is_version_1, i
|
||||
|
||||
return 1;
|
||||
}
|
||||
if (get_tmr() > timeout)
|
||||
if (get_tmr_us() > timeout)
|
||||
break;
|
||||
sleep(10000); // Needs to be at least 10ms for some SD Cards
|
||||
}
|
||||
@@ -646,7 +646,7 @@ static int _sd_storage_get_rca(sdmmc_storage_t *storage)
|
||||
sdmmc_cmd_t cmdbuf;
|
||||
sdmmc_init_cmd(&cmdbuf, SD_SEND_RELATIVE_ADDR, 0, SDMMC_RSP_TYPE_4, 0);
|
||||
|
||||
u32 timeout = get_tmr() + 1500000;
|
||||
u32 timeout = get_tmr_us() + 1500000;
|
||||
|
||||
while (1)
|
||||
{
|
||||
@@ -663,7 +663,7 @@ static int _sd_storage_get_rca(sdmmc_storage_t *storage)
|
||||
return 1;
|
||||
}
|
||||
|
||||
if (get_tmr() > timeout)
|
||||
if (get_tmr_us() > timeout)
|
||||
break;
|
||||
sleep(1000);
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user