diff options
author | Jens Arnold <amiconn@rockbox.org> | 2007-07-31 09:33:45 +0000 |
---|---|---|
committer | Jens Arnold <amiconn@rockbox.org> | 2007-07-31 09:33:45 +0000 |
commit | 9bba398e685ad07c102df5454a363040ef5b3d50 (patch) | |
tree | a0efa68113dbefbf3757907a079b353137ba8ea2 | |
parent | 5c7b46e5871d6e999bbd065e1cf16f90431a15b0 (diff) | |
download | rockbox-9bba398e685ad07c102df5454a363040ef5b3d50.tar.gz rockbox-9bba398e685ad07c102df5454a363040ef5b3d50.zip |
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
-rw-r--r-- | firmware/target/arm/system-pp502x.c | 68 |
1 files 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; | |||
27 | #ifndef BOOTLOADER | 27 | #ifndef BOOTLOADER |
28 | extern void TIMER1(void); | 28 | extern void TIMER1(void); |
29 | extern void TIMER2(void); | 29 | extern void TIMER2(void); |
30 | 30 | extern void ipod_mini_button_int(void); /* iPod Mini 1st gen only */ | |
31 | #if defined(IPOD_MINI) /* mini 1 only, mini 2G uses iPod 4G code */ | 31 | extern void ipod_4g_button_int(void); /* iPod 4th gen and higher only */ |
32 | extern void ipod_mini_button_int(void); | 32 | #ifdef SANSA_E200 |
33 | extern void button_int(void); | ||
34 | extern void clickwheel_int(void); | ||
35 | extern void microsd_int(void); | ||
36 | #endif | ||
33 | 37 | ||
34 | void irq(void) | 38 | void irq(void) |
35 | { | 39 | { |
@@ -39,38 +43,13 @@ void irq(void) | |||
39 | TIMER1(); | 43 | TIMER1(); |
40 | else if (CPU_INT_STAT & TIMER2_MASK) | 44 | else if (CPU_INT_STAT & TIMER2_MASK) |
41 | TIMER2(); | 45 | TIMER2(); |
46 | #if defined(IPOD_MINI) /* Mini 1st gen only, mini 2nd gen uses iPod 4G code */ | ||
42 | else if (CPU_HI_INT_STAT & GPIO_MASK) | 47 | else if (CPU_HI_INT_STAT & GPIO_MASK) |
43 | ipod_mini_button_int(); | 48 | ipod_mini_button_int(); |
44 | } else { | 49 | #elif CONFIG_KEYPAD == IPOD_4G_PAD /* except Mini 1st gen, handled above */ |
45 | if (COP_INT_STAT & TIMER1_MASK) | 50 | else if (CPU_HI_INT_STAT & I2C_MASK) |
46 | TIMER1(); | 51 | ipod_4g_button_int(); |
47 | else if (COP_INT_STAT & TIMER2_MASK) | 52 | #elif defined(SANSA_E200) |
48 | TIMER2(); | ||
49 | else if (COP_HI_INT_STAT & GPIO_MASK) | ||
50 | ipod_mini_button_int(); | ||
51 | } | ||
52 | } | ||
53 | #elif (defined IRIVER_H10) || (defined IRIVER_H10_5GB) || defined(ELIO_TPJ1022) \ | ||
54 | || (defined SANSA_E200) | ||
55 | /* TODO: this should really be in the target tree, but moving it there caused | ||
56 | crt0.S not to find it while linking */ | ||
57 | /* TODO: Even if it isn't in the target tree, this should be the default case */ | ||
58 | #ifdef SANSA_E200 | ||
59 | extern void button_int(void); | ||
60 | extern void clickwheel_int(void); | ||
61 | extern void microsd_int(void); | ||
62 | #endif | ||
63 | |||
64 | void irq(void) | ||
65 | { | ||
66 | if(CURRENT_CORE == CPU) { | ||
67 | if (CPU_INT_STAT & TIMER1_MASK) { | ||
68 | TIMER1(); | ||
69 | } | ||
70 | else if (CPU_INT_STAT & TIMER2_MASK) { | ||
71 | TIMER2(); | ||
72 | } | ||
73 | #ifdef SANSA_E200 | ||
74 | else if (CPU_HI_INT_STAT & GPIO0_MASK) { | 53 | else if (CPU_HI_INT_STAT & GPIO0_MASK) { |
75 | if (GPIOA_INT_STAT & 0x80) | 54 | if (GPIOA_INT_STAT & 0x80) |
76 | microsd_int(); | 55 | microsd_int(); |
@@ -89,29 +68,6 @@ void irq(void) | |||
89 | TIMER2(); | 68 | TIMER2(); |
90 | } | 69 | } |
91 | } | 70 | } |
92 | #else | ||
93 | extern void ipod_4g_button_int(void); | ||
94 | |||
95 | void irq(void) | ||
96 | { | ||
97 | if(CURRENT_CORE == CPU) | ||
98 | { | ||
99 | if (CPU_INT_STAT & TIMER1_MASK) | ||
100 | TIMER1(); | ||
101 | else if (CPU_INT_STAT & TIMER2_MASK) | ||
102 | TIMER2(); | ||
103 | else if (CPU_HI_INT_STAT & I2C_MASK) | ||
104 | ipod_4g_button_int(); | ||
105 | } else { | ||
106 | if (COP_INT_STAT & TIMER1_MASK) | ||
107 | TIMER1(); | ||
108 | else if (COP_INT_STAT & TIMER2_MASK) | ||
109 | TIMER2(); | ||
110 | else if (COP_HI_INT_STAT & I2C_MASK) | ||
111 | ipod_4g_button_int(); | ||
112 | } | ||
113 | } | ||
114 | #endif | ||
115 | #endif /* BOOTLOADER */ | 71 | #endif /* BOOTLOADER */ |
116 | 72 | ||
117 | /* TODO: The following function has been lifted straight from IPL, and | 73 | /* TODO: The following function has been lifted straight from IPL, and |