summaryrefslogtreecommitdiff
path: root/firmware/target/arm
diff options
context:
space:
mode:
Diffstat (limited to 'firmware/target/arm')
-rw-r--r--firmware/target/arm/as3525/ata_sd_as3525.c5
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)
sd_init_card(SD_SLOT_AS3525);
#endif
/* init mutex */
+
+ sd_enable(false);
+
mutex_init(&sd_mtx);
queue_init(&sd_queue, true);
@@ -493,6 +496,7 @@ static int sd_transfer_sectors(IF_MV2(int drive,) unsigned long start,
#endif
mutex_lock(&sd_mtx);
+ sd_enable(true);
#ifdef HAVE_MULTIVOLUME
if (drive != 0 && !card_detect_target())
@@ -579,6 +583,7 @@ static int sd_transfer_sectors(IF_MV2(int drive,) unsigned long start,
while (1)
{
+ sd_enable(false);
mutex_unlock(&sd_mtx);
return ret;