mirror of
https://github.com/RIOT-OS/RIOT.git
synced 2025-12-16 10:03:50 +01:00
drivers/{mtd_sdmmc,sdmmc}: reinit card
This commit is contained in:
parent
0cb550a2cd
commit
6174ca6c29
@ -41,8 +41,7 @@ static int mtd_sdmmc_init(mtd_dev_t *dev)
|
|||||||
/* get the SDMMC device descriptor from SDMMC peripheral index */
|
/* get the SDMMC device descriptor from SDMMC peripheral index */
|
||||||
mtd_sd->sdmmc = sdmmc_get_dev(mtd_sd->sdmmc_idx);
|
mtd_sd->sdmmc = sdmmc_get_dev(mtd_sd->sdmmc_idx);
|
||||||
|
|
||||||
if ((mtd_sd->sdmmc->init_done == true) ||
|
if (sdmmc_card_init(mtd_sd->sdmmc) == 0) {
|
||||||
(sdmmc_card_init(mtd_sd->sdmmc) == 0)) {
|
|
||||||
/* erasing whole sectors is handled internally by the card so you can
|
/* erasing whole sectors is handled internally by the card so you can
|
||||||
delete single blocks (i.e. pages) */
|
delete single blocks (i.e. pages) */
|
||||||
dev->pages_per_sector = 1;
|
dev->pages_per_sector = 1;
|
||||||
|
|||||||
@ -338,6 +338,8 @@ int sdmmc_card_init(sdmmc_dev_t *dev)
|
|||||||
assert(dev);
|
assert(dev);
|
||||||
assert(dev->driver);
|
assert(dev->driver);
|
||||||
|
|
||||||
|
dev->init_done = false;
|
||||||
|
|
||||||
/* use driver's card_init function if it defines its own */
|
/* use driver's card_init function if it defines its own */
|
||||||
if (dev->driver->card_init) {
|
if (dev->driver->card_init) {
|
||||||
return dev->driver->card_init(dev);
|
return dev->driver->card_init(dev);
|
||||||
|
|||||||
Loading…
x
Reference in New Issue
Block a user