Commit FS#9652 by Thomas Martitz. Enable microSD on e200v2 and fix initialization for the fuze and e200v2.

git-svn-id: svn://svn.rockbox.org/rockbox/trunk@19451 a1c6a512-1295-4272-9138-f99709370657
This commit is contained in:
Michael Giacomelli 2008-12-16 02:04:08 +00:00
parent 66b97219fc
commit 8493da0974

View file

@ -154,7 +154,7 @@ static void sd_panic(IF_MV2(const int drive,) const int status)
} }
#ifdef HAVE_HOTSWAP #ifdef HAVE_HOTSWAP
#ifdef SANSA_FUZE #if defined(SANSA_E200V2) || defined(SANSA_FUZE)
static bool sd1_oneshot_callback(struct timeout *tmo) static bool sd1_oneshot_callback(struct timeout *tmo)
{ {
(void)tmo; (void)tmo;
@ -381,11 +381,9 @@ static void sd_thread(void)
if (ev.id == SYS_HOTSWAP_INSERTED) if (ev.id == SYS_HOTSWAP_INSERTED)
{ {
disk_mount(1); sd_enable(true);
}
else
{
init_pl180_controller(SD_SLOT_AS3525); init_pl180_controller(SD_SLOT_AS3525);
disk_mount(1);
} }
queue_broadcast(SYS_FS_CHANGED, 0); queue_broadcast(SYS_FS_CHANGED, 0);
@ -438,7 +436,7 @@ static void init_pl180_controller(const int drive)
VIC_INT_ENABLE |= VIC_INT_ENABLE |=
(drive == INTERNAL_AS3525) ? INTERRUPT_NAND : INTERRUPT_MCI0; (drive == INTERNAL_AS3525) ? INTERRUPT_NAND : INTERRUPT_MCI0;
#ifdef SANSA_FUZE #if defined(SANSA_E200V2) || defined(SANSA_FUZE)
/* setup isr for microsd monitoring */ /* setup isr for microsd monitoring */
VIC_INT_ENABLE |= (INTERRUPT_GPIOA); VIC_INT_ENABLE |= (INTERRUPT_GPIOA);
/* clear previous irq */ /* clear previous irq */
@ -798,7 +796,7 @@ bool card_detect_target(void)
{ {
#ifdef HAVE_HOTSWAP #ifdef HAVE_HOTSWAP
/* TODO: add e200/c200 */ /* TODO: add e200/c200 */
#if defined(SANSA_FUZE) #if defined(SANSA_E200V2) || defined(SANSA_FUZE)
return !(GPIOA_PIN(2)); return !(GPIOA_PIN(2));
#endif #endif
#endif #endif
@ -811,14 +809,14 @@ void card_enable_monitoring_target(bool on)
if (on) if (on)
{ {
/* add e200v2/c200v2 here */ /* add e200v2/c200v2 here */
#ifdef SANSA_FUZE #if defined(SANSA_E200V2) || defined(SANSA_FUZE)
/* enable isr*/ /* enable isr*/
GPIOA_IE |= (1<<2); GPIOA_IE |= (1<<2);
#endif #endif
} }
else else
{ {
#ifdef SANSA_FUZE #if defined(SANSA_E200V2) || defined(SANSA_FUZE)
/* edisable isr*/ /* edisable isr*/
GPIOA_IE &= ~(1<<2); GPIOA_IE &= ~(1<<2);
#endif #endif