Index: emcore/trunk/target/ipodnano2g/s5l8701.h |
— | — | @@ -248,6 +248,7 @@ |
249 | 249 | |
250 | 250 | |
251 | 251 | /////TIMER///// |
| 252 | +#define TCON(x) (*((uint32_t volatile*)(0x3C700000 + 0x20 * (x)))) |
252 | 253 | #define TACON (*((uint32_t volatile*)(0x3C700000))) |
253 | 254 | #define TACMD (*((uint32_t volatile*)(0x3C700004))) |
254 | 255 | #define TADATA0 (*((uint32_t volatile*)(0x3C700008))) |
Index: emcore/trunk/target/ipodnano2g/interrupt.c |
— | — | @@ -87,10 +87,12 @@ |
88 | 88 | void INT_TIMER(void) ICODE_ATTR;
|
89 | 89 | void INT_TIMER()
|
90 | 90 | {
|
91 | | - if (TACON & (TACON >> 4) & 0x7000) timervector[0]();
|
92 | | - if (TBCON & (TBCON >> 4) & 0x7000) timervector[1]();
|
93 | | - if (TCCON & (TCCON >> 4) & 0x7000) timervector[2]();
|
94 | | - if (TDCON & (TDCON >> 4) & 0x7000) timervector[3]();
|
| 91 | + int i;
|
| 92 | + for (i = 0; i < ARRAYLEN(timervector); i++)
|
| 93 | + {
|
| 94 | + int tcon = TCON(i);
|
| 95 | + if (tcon & (tcon >> 4) & 0x7000) timervector[i]();
|
| 96 | + }
|
95 | 97 | }
|
96 | 98 |
|
97 | 99 | static void (* dmavector[])(void) IDATA_ATTR =
|
Index: emcore/trunk/target/ipodnano3g/s5l8702.h |
— | — | @@ -37,6 +37,7 @@ |
38 | 38 | |
39 | 39 | |
40 | 40 | /////TIMER///// |
| 41 | +#define TCON(x) (*((uint32_t volatile*)(0x3C700000 + 0x20 * (x)))) |
41 | 42 | #define TACON (*((uint32_t volatile*)(0x3C700000))) |
42 | 43 | #define TACMD (*((uint32_t volatile*)(0x3C700004))) |
43 | 44 | #define TADATA0 (*((uint32_t volatile*)(0x3C700008))) |
Index: emcore/trunk/target/ipodnano3g/interrupt.c |
— | — | @@ -132,13 +132,12 @@ |
133 | 133 | void INT_TIMER(void) ICODE_ATTR;
|
134 | 134 | void INT_TIMER()
|
135 | 135 | {
|
136 | | - if (TACON & (TACON >> 4) & 0x7000) timervector[0]();
|
137 | | - if (TBCON & (TBCON >> 4) & 0x7000) timervector[1]();
|
138 | | - if (TCCON & (TCCON >> 4) & 0x7000) timervector[2]();
|
139 | | - if (TDCON & (TDCON >> 4) & 0x7000) timervector[3]();
|
140 | | - if (TFCON & (TFCON >> 4) & 0x7000) timervector[5]();
|
141 | | - if (TGCON & (TGCON >> 4) & 0x7000) timervector[6]();
|
142 | | - if (THCON & (THCON >> 4) & 0x7000) timervector[7]();
|
| 136 | + int i;
|
| 137 | + for (i = 0; i < ARRAYLEN(timervector); i++)
|
| 138 | + {
|
| 139 | + int tcon = TCON(i);
|
| 140 | + if (tcon & (tcon >> 4) & 0x7000) timervector[i]();
|
| 141 | + }
|
143 | 142 | }
|
144 | 143 |
|
145 | 144 | static void (* dmavector[])(void) IDATA_ATTR =
|
Index: emcore/trunk/target/ipodnano4g/s5l8720.h |
— | — | @@ -37,6 +37,7 @@ |
38 | 38 |
|
39 | 39 |
|
40 | 40 | /////TIMER/////
|
| 41 | +#define TCON(x) (*((uint32_t volatile*)(0x3C700000 + 0x20 * (x))))
|
41 | 42 | #define TACON (*((uint32_t volatile*)(0x3C700000)))
|
42 | 43 | #define TACMD (*((uint32_t volatile*)(0x3C700004)))
|
43 | 44 | #define TADATA0 (*((uint32_t volatile*)(0x3C700008)))
|
Index: emcore/trunk/target/ipodnano4g/interrupt.c |
— | — | @@ -132,13 +132,12 @@ |
133 | 133 | void INT_TIMER(void) ICODE_ATTR;
|
134 | 134 | void INT_TIMER()
|
135 | 135 | {
|
136 | | - if (TACON & (TACON >> 4) & 0x7000) timervector[0]();
|
137 | | - if (TBCON & (TBCON >> 4) & 0x7000) timervector[1]();
|
138 | | - if (TCCON & (TCCON >> 4) & 0x7000) timervector[2]();
|
139 | | - if (TDCON & (TDCON >> 4) & 0x7000) timervector[3]();
|
140 | | - if (TFCON & (TFCON >> 4) & 0x7000) timervector[5]();
|
141 | | - if (TGCON & (TGCON >> 4) & 0x7000) timervector[6]();
|
142 | | - if (THCON & (THCON >> 4) & 0x7000) timervector[7]();
|
| 136 | + int i;
|
| 137 | + for (i = 0; i < ARRAYLEN(timervector); i++)
|
| 138 | + {
|
| 139 | + int tcon = TCON(i);
|
| 140 | + if (tcon & (tcon >> 4) & 0x7000) timervector[i]();
|
| 141 | + }
|
143 | 142 | }
|
144 | 143 |
|
145 | 144 | static void (* dmavector[])(void) IDATA_ATTR =
|