summaryrefslogtreecommitdiff
path: root/firmware/target
diff options
context:
space:
mode:
Diffstat (limited to 'firmware/target')
-rw-r--r--firmware/target/arm/system-pp502x.c68
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
28extern void TIMER1(void); 28extern void TIMER1(void);
29extern void TIMER2(void); 29extern void TIMER2(void);
30 30extern 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 */ 31extern void ipod_4g_button_int(void); /* iPod 4th gen and higher only */
32extern void ipod_mini_button_int(void); 32#ifdef SANSA_E200
33extern void button_int(void);
34extern void clickwheel_int(void);
35extern void microsd_int(void);
36#endif
33 37
34void irq(void) 38void 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
59extern void button_int(void);
60extern void clickwheel_int(void);
61extern void microsd_int(void);
62#endif
63
64void 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
93extern void ipod_4g_button_int(void);
94
95void 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