From 9bba398e685ad07c102df5454a363040ef5b3d50 Mon Sep 17 00:00:00 2001 From: Jens Arnold Date: Tue, 31 Jul 2007 09:33:45 +0000 Subject: Unify the 3 copies of the PP502x IRQ handler, and don't schedule button interrupts to the COP. git-svn-id: svn://svn.rockbox.org/rockbox/trunk@14092 a1c6a512-1295-4272-9138-f99709370657 --- firmware/target/arm/system-pp502x.c | 68 +++++++------------------------------ 1 file changed, 12 insertions(+), 56 deletions(-) diff --git a/firmware/target/arm/system-pp502x.c b/firmware/target/arm/system-pp502x.c index 5d989c030e..d32e74345f 100644 --- a/firmware/target/arm/system-pp502x.c +++ b/firmware/target/arm/system-pp502x.c @@ -27,9 +27,13 @@ struct mutex boostctrl_mtx NOCACHEBSS_ATTR; #ifndef BOOTLOADER extern void TIMER1(void); extern void TIMER2(void); - -#if defined(IPOD_MINI) /* mini 1 only, mini 2G uses iPod 4G code */ -extern void ipod_mini_button_int(void); +extern void ipod_mini_button_int(void); /* iPod Mini 1st gen only */ +extern void ipod_4g_button_int(void); /* iPod 4th gen and higher only */ +#ifdef SANSA_E200 +extern void button_int(void); +extern void clickwheel_int(void); +extern void microsd_int(void); +#endif void irq(void) { @@ -39,38 +43,13 @@ void irq(void) TIMER1(); else if (CPU_INT_STAT & TIMER2_MASK) TIMER2(); +#if defined(IPOD_MINI) /* Mini 1st gen only, mini 2nd gen uses iPod 4G code */ else if (CPU_HI_INT_STAT & GPIO_MASK) ipod_mini_button_int(); - } else { - if (COP_INT_STAT & TIMER1_MASK) - TIMER1(); - else if (COP_INT_STAT & TIMER2_MASK) - TIMER2(); - else if (COP_HI_INT_STAT & GPIO_MASK) - ipod_mini_button_int(); - } -} -#elif (defined IRIVER_H10) || (defined IRIVER_H10_5GB) || defined(ELIO_TPJ1022) \ - || (defined SANSA_E200) -/* TODO: this should really be in the target tree, but moving it there caused - crt0.S not to find it while linking */ -/* TODO: Even if it isn't in the target tree, this should be the default case */ -#ifdef SANSA_E200 -extern void button_int(void); -extern void clickwheel_int(void); -extern void microsd_int(void); -#endif - -void irq(void) -{ - if(CURRENT_CORE == CPU) { - if (CPU_INT_STAT & TIMER1_MASK) { - TIMER1(); - } - else if (CPU_INT_STAT & TIMER2_MASK) { - TIMER2(); - } -#ifdef SANSA_E200 +#elif CONFIG_KEYPAD == IPOD_4G_PAD /* except Mini 1st gen, handled above */ + else if (CPU_HI_INT_STAT & I2C_MASK) + ipod_4g_button_int(); +#elif defined(SANSA_E200) else if (CPU_HI_INT_STAT & GPIO0_MASK) { if (GPIOA_INT_STAT & 0x80) microsd_int(); @@ -89,29 +68,6 @@ void irq(void) TIMER2(); } } -#else -extern void ipod_4g_button_int(void); - -void irq(void) -{ - if(CURRENT_CORE == CPU) - { - if (CPU_INT_STAT & TIMER1_MASK) - TIMER1(); - else if (CPU_INT_STAT & TIMER2_MASK) - TIMER2(); - else if (CPU_HI_INT_STAT & I2C_MASK) - ipod_4g_button_int(); - } else { - if (COP_INT_STAT & TIMER1_MASK) - TIMER1(); - else if (COP_INT_STAT & TIMER2_MASK) - TIMER2(); - else if (COP_HI_INT_STAT & I2C_MASK) - ipod_4g_button_int(); - } -} -#endif #endif /* BOOTLOADER */ /* TODO: The following function has been lifted straight from IPL, and -- cgit v1.2.3