diff options
Diffstat (limited to 'firmware/target/arm/as3525/sd-as3525.c')
-rw-r--r-- | firmware/target/arm/as3525/sd-as3525.c | 21 |
1 files changed, 10 insertions, 11 deletions
diff --git a/firmware/target/arm/as3525/sd-as3525.c b/firmware/target/arm/as3525/sd-as3525.c index 1cf7e51cf8..9c3ff0b5fe 100644 --- a/firmware/target/arm/as3525/sd-as3525.c +++ b/firmware/target/arm/as3525/sd-as3525.c | |||
@@ -131,6 +131,7 @@ bool sd_enabled = false; | |||
131 | 131 | ||
132 | #if defined(HAVE_MULTIDRIVE) | 132 | #if defined(HAVE_MULTIDRIVE) |
133 | static bool hs_card = false; | 133 | static bool hs_card = false; |
134 | #define EXT_SD_BITS (1<<2) | ||
134 | #endif | 135 | #endif |
135 | 136 | ||
136 | static struct wakeup transfer_completion_signal; | 137 | static struct wakeup transfer_completion_signal; |
@@ -172,12 +173,13 @@ static int sd1_oneshot_callback(struct timeout *tmo) | |||
172 | return 0; | 173 | return 0; |
173 | } | 174 | } |
174 | 175 | ||
175 | void INT_GPIOA(void) | 176 | void sd_gpioa_isr(void) |
176 | { | 177 | { |
177 | static struct timeout sd1_oneshot; | 178 | static struct timeout sd1_oneshot; |
179 | if (GPIOA_MIS & EXT_SD_BITS) | ||
180 | timeout_register(&sd1_oneshot, sd1_oneshot_callback, (3*HZ/10), 0); | ||
178 | /* acknowledge interrupt */ | 181 | /* acknowledge interrupt */ |
179 | GPIOA_IC = (1<<2); | 182 | GPIOA_IC = EXT_SD_BITS; |
180 | timeout_register(&sd1_oneshot, sd1_oneshot_callback, (3*HZ/10), 0); | ||
181 | } | 183 | } |
182 | #endif /* HAVE_HOTSWAP */ | 184 | #endif /* HAVE_HOTSWAP */ |
183 | 185 | ||
@@ -479,15 +481,12 @@ static void init_pl180_controller(const int drive) | |||
479 | #ifdef HAVE_MULTIDRIVE | 481 | #ifdef HAVE_MULTIDRIVE |
480 | VIC_INT_ENABLE = | 482 | VIC_INT_ENABLE = |
481 | (drive == INTERNAL_AS3525) ? INTERRUPT_NAND : INTERRUPT_MCI0; | 483 | (drive == INTERNAL_AS3525) ? INTERRUPT_NAND : INTERRUPT_MCI0; |
482 | |||
483 | /* setup isr for microsd monitoring */ | ||
484 | VIC_INT_ENABLE = (INTERRUPT_GPIOA); | ||
485 | /* clear previous irq */ | 484 | /* clear previous irq */ |
486 | GPIOA_IC = (1<<2); | 485 | GPIOA_IC = EXT_SD_BITS; |
487 | /* enable edge detecting */ | 486 | /* enable edge detecting */ |
488 | GPIOA_IS &= ~(1<<2); | 487 | GPIOA_IS &= ~EXT_SD_BITS; |
489 | /* detect both raising and falling edges */ | 488 | /* detect both raising and falling edges */ |
490 | GPIOA_IBE |= (1<<2); | 489 | GPIOA_IBE |= EXT_SD_BITS; |
491 | 490 | ||
492 | #else | 491 | #else |
493 | VIC_INT_ENABLE = INTERRUPT_NAND; | 492 | VIC_INT_ENABLE = INTERRUPT_NAND; |
@@ -910,9 +909,9 @@ tCardInfo *card_get_info_target(int card_no) | |||
910 | void card_enable_monitoring_target(bool on) | 909 | void card_enable_monitoring_target(bool on) |
911 | { | 910 | { |
912 | if (on) /* enable interrupt */ | 911 | if (on) /* enable interrupt */ |
913 | GPIOA_IE |= (1<<2); | 912 | GPIOA_IE |= EXT_SD_BITS; |
914 | else /* disable interrupt */ | 913 | else /* disable interrupt */ |
915 | GPIOA_IE &= ~(1<<2); | 914 | GPIOA_IE &= ~EXT_SD_BITS; |
916 | } | 915 | } |
917 | #endif /* HAVE_HOTSWAP */ | 916 | #endif /* HAVE_HOTSWAP */ |
918 | 917 | ||