diff options
-rw-r--r-- | firmware/target/arm/as3525/ata_sd_as3525.c | 16 |
1 files changed, 7 insertions, 9 deletions
diff --git a/firmware/target/arm/as3525/ata_sd_as3525.c b/firmware/target/arm/as3525/ata_sd_as3525.c index 3cc8ed8282..f71de7fdc0 100644 --- a/firmware/target/arm/as3525/ata_sd_as3525.c +++ b/firmware/target/arm/as3525/ata_sd_as3525.c | |||
@@ -154,7 +154,7 @@ static void sd_panic(IF_MV2(const int drive,) const int status) | |||
154 | } | 154 | } |
155 | 155 | ||
156 | #ifdef HAVE_HOTSWAP | 156 | #ifdef HAVE_HOTSWAP |
157 | #ifdef SANSA_FUZE | 157 | #if defined(SANSA_E200V2) || defined(SANSA_FUZE) |
158 | static bool sd1_oneshot_callback(struct timeout *tmo) | 158 | static bool sd1_oneshot_callback(struct timeout *tmo) |
159 | { | 159 | { |
160 | (void)tmo; | 160 | (void)tmo; |
@@ -381,11 +381,9 @@ static void sd_thread(void) | |||
381 | 381 | ||
382 | if (ev.id == SYS_HOTSWAP_INSERTED) | 382 | if (ev.id == SYS_HOTSWAP_INSERTED) |
383 | { | 383 | { |
384 | disk_mount(1); | 384 | sd_enable(true); |
385 | } | ||
386 | else | ||
387 | { | ||
388 | init_pl180_controller(SD_SLOT_AS3525); | 385 | init_pl180_controller(SD_SLOT_AS3525); |
386 | disk_mount(1); | ||
389 | } | 387 | } |
390 | 388 | ||
391 | queue_broadcast(SYS_FS_CHANGED, 0); | 389 | queue_broadcast(SYS_FS_CHANGED, 0); |
@@ -438,7 +436,7 @@ static void init_pl180_controller(const int drive) | |||
438 | VIC_INT_ENABLE |= | 436 | VIC_INT_ENABLE |= |
439 | (drive == INTERNAL_AS3525) ? INTERRUPT_NAND : INTERRUPT_MCI0; | 437 | (drive == INTERNAL_AS3525) ? INTERRUPT_NAND : INTERRUPT_MCI0; |
440 | 438 | ||
441 | #ifdef SANSA_FUZE | 439 | #if defined(SANSA_E200V2) || defined(SANSA_FUZE) |
442 | /* setup isr for microsd monitoring */ | 440 | /* setup isr for microsd monitoring */ |
443 | VIC_INT_ENABLE |= (INTERRUPT_GPIOA); | 441 | VIC_INT_ENABLE |= (INTERRUPT_GPIOA); |
444 | /* clear previous irq */ | 442 | /* clear previous irq */ |
@@ -798,7 +796,7 @@ bool card_detect_target(void) | |||
798 | { | 796 | { |
799 | #ifdef HAVE_HOTSWAP | 797 | #ifdef HAVE_HOTSWAP |
800 | /* TODO: add e200/c200 */ | 798 | /* TODO: add e200/c200 */ |
801 | #if defined(SANSA_FUZE) | 799 | #if defined(SANSA_E200V2) || defined(SANSA_FUZE) |
802 | return !(GPIOA_PIN(2)); | 800 | return !(GPIOA_PIN(2)); |
803 | #endif | 801 | #endif |
804 | #endif | 802 | #endif |
@@ -811,14 +809,14 @@ void card_enable_monitoring_target(bool on) | |||
811 | if (on) | 809 | if (on) |
812 | { | 810 | { |
813 | /* add e200v2/c200v2 here */ | 811 | /* add e200v2/c200v2 here */ |
814 | #ifdef SANSA_FUZE | 812 | #if defined(SANSA_E200V2) || defined(SANSA_FUZE) |
815 | /* enable isr*/ | 813 | /* enable isr*/ |
816 | GPIOA_IE |= (1<<2); | 814 | GPIOA_IE |= (1<<2); |
817 | #endif | 815 | #endif |
818 | } | 816 | } |
819 | else | 817 | else |
820 | { | 818 | { |
821 | #ifdef SANSA_FUZE | 819 | #if defined(SANSA_E200V2) || defined(SANSA_FUZE) |
822 | /* edisable isr*/ | 820 | /* edisable isr*/ |
823 | GPIOA_IE &= ~(1<<2); | 821 | GPIOA_IE &= ~(1<<2); |
824 | #endif | 822 | #endif |