summaryrefslogtreecommitdiff
path: root/firmware/target/arm/as3525/ata_sd_as3525.c
diff options
context:
space:
mode:
Diffstat (limited to 'firmware/target/arm/as3525/ata_sd_as3525.c')
-rw-r--r--firmware/target/arm/as3525/ata_sd_as3525.c21
1 files changed, 21 insertions, 0 deletions
diff --git a/firmware/target/arm/as3525/ata_sd_as3525.c b/firmware/target/arm/as3525/ata_sd_as3525.c
index 92dc0b746b..57dc307e7f 100644
--- a/firmware/target/arm/as3525/ata_sd_as3525.c
+++ b/firmware/target/arm/as3525/ata_sd_as3525.c
@@ -812,6 +812,11 @@ void sd_enable(bool on)
812#if defined(HAVE_BUTTON_LIGHT) && defined(HAVE_MULTIDRIVE) 812#if defined(HAVE_BUTTON_LIGHT) && defined(HAVE_MULTIDRIVE)
813 extern int buttonlight_is_on; 813 extern int buttonlight_is_on;
814#endif 814#endif
815
816#ifdef HAVE_HOTSWAP
817 static bool cpu_boosted = false;
818#endif
819
815 if (sd_enabled == on) 820 if (sd_enabled == on)
816 return; /* nothing to do */ 821 return; /* nothing to do */
817 if(on) 822 if(on)
@@ -830,6 +835,14 @@ void sd_enable(bool on)
830 CGU_IDE |= (1<<7) /* AHB interface enable */ | 835 CGU_IDE |= (1<<7) /* AHB interface enable */ |
831 (1<<6) /* interface enable */; 836 (1<<6) /* interface enable */;
832 sd_enabled = true; 837 sd_enabled = true;
838
839#ifdef HAVE_HOTSWAP
840 if(card_detect_target()) /* If SD card present Boost cpu for voltage */
841 {
842 cpu_boosted = true;
843 cpu_boost(true);
844 }
845#endif
833 } 846 }
834 else 847 else
835 { 848 {
@@ -844,6 +857,14 @@ void sd_enable(bool on)
844#endif /* HAVE_MULTIDRIVE */ 857#endif /* HAVE_MULTIDRIVE */
845 CGU_IDE &= ~((1<<7)|(1<<6)); 858 CGU_IDE &= ~((1<<7)|(1<<6));
846 sd_enabled = false; 859 sd_enabled = false;
860
861#ifdef HAVE_HOTSWAP
862 if(cpu_boosted)
863 {
864 cpu_boost(false);
865 cpu_boosted = false;
866 }
867#endif
847 } 868 }
848} 869}
849 870