summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
-rw-r--r--firmware/target/arm/as3525/sd-as3525v2.c10
1 files changed, 3 insertions, 7 deletions
diff --git a/firmware/target/arm/as3525/sd-as3525v2.c b/firmware/target/arm/as3525/sd-as3525v2.c
index f33dee6..1df7f33 100644
--- a/firmware/target/arm/as3525/sd-as3525v2.c
+++ b/firmware/target/arm/as3525/sd-as3525v2.c
@@ -600,7 +600,7 @@ static void sd_thread(void)
case SYS_HOTSWAP_INSERTED:
case SYS_HOTSWAP_EXTRACTED:
{
- int microsd_init = 1;
+ int changed = 1;
fat_lock(); /* lock-out FAT activity first -
prevent deadlocking via disk_mount that
would cause a reverse-order attempt with
@@ -620,18 +620,14 @@ static void sd_thread(void)
if (ev.id == SYS_HOTSWAP_INSERTED)
{
sd_enable(true);
- microsd_init = sd_init_card(SD_SLOT_AS3525);
- if (microsd_init < 0) /* initialisation failed */
- panicf("microSD init failed : %d", microsd_init);
-
- microsd_init = disk_mount(SD_SLOT_AS3525); /* 0 if fail */
+ changed = (sd_init_card(SD_SLOT_AS3525) == 0) && disk_mount(SD_SLOT_AS3525); /* 0 if fail */
}
/*
* Mount succeeded, or this was an EXTRACTED event,
* in both cases notify the system about the changed filesystems
*/
- if (microsd_init)
+ if (changed)
queue_broadcast(SYS_FS_CHANGED, 0);
sd_enable(false);