diff options
Diffstat (limited to 'firmware/target/arm/as3525')
-rw-r--r-- | firmware/target/arm/as3525/ata_sd_as3525.c | 5 |
1 files changed, 5 insertions, 0 deletions
diff --git a/firmware/target/arm/as3525/ata_sd_as3525.c b/firmware/target/arm/as3525/ata_sd_as3525.c index f6c8b2de24..2270894be5 100644 --- a/firmware/target/arm/as3525/ata_sd_as3525.c +++ b/firmware/target/arm/as3525/ata_sd_as3525.c | |||
@@ -405,6 +405,9 @@ int sd_init(void) | |||
405 | sd_init_card(SD_SLOT_AS3525); | 405 | sd_init_card(SD_SLOT_AS3525); |
406 | #endif | 406 | #endif |
407 | /* init mutex */ | 407 | /* init mutex */ |
408 | |||
409 | sd_enable(false); | ||
410 | |||
408 | mutex_init(&sd_mtx); | 411 | mutex_init(&sd_mtx); |
409 | 412 | ||
410 | queue_init(&sd_queue, true); | 413 | queue_init(&sd_queue, true); |
@@ -493,6 +496,7 @@ static int sd_transfer_sectors(IF_MV2(int drive,) unsigned long start, | |||
493 | #endif | 496 | #endif |
494 | 497 | ||
495 | mutex_lock(&sd_mtx); | 498 | mutex_lock(&sd_mtx); |
499 | sd_enable(true); | ||
496 | 500 | ||
497 | #ifdef HAVE_MULTIVOLUME | 501 | #ifdef HAVE_MULTIVOLUME |
498 | if (drive != 0 && !card_detect_target()) | 502 | if (drive != 0 && !card_detect_target()) |
@@ -579,6 +583,7 @@ static int sd_transfer_sectors(IF_MV2(int drive,) unsigned long start, | |||
579 | 583 | ||
580 | while (1) | 584 | while (1) |
581 | { | 585 | { |
586 | sd_enable(false); | ||
582 | mutex_unlock(&sd_mtx); | 587 | mutex_unlock(&sd_mtx); |
583 | 588 | ||
584 | return ret; | 589 | return ret; |