freemyipod r282 - Code Review

Jump to: navigation, search
Repository:freemyipod
Revision:r281‎ | r282 | r283 >
Date:19:35, 27 November 2010
Author:theseven
Status:new
Tags:
Comment:
emBIOS: Fix timer IRQ handling
Modified paths:
  • /embios/trunk/target/ipodnano2g/interrupt.c (modified) (history)
  • /embios/trunk/target/ipodnano3g/interrupt.c (modified) (history)
  • /embios/trunk/target/ipodnano4g/interrupt.c (modified) (history)

Diff [purge]

Index: embios/trunk/target/ipodnano2g/interrupt.c
@@ -87,10 +87,10 @@
8888 void INT_TIMER(void) ICODE_ATTR;
8989 void INT_TIMER()
9090 {
91 - if (TACON & 0x00038000) timervector[0]();
92 - if (TBCON & 0x00038000) timervector[1]();
93 - if (TCCON & 0x00038000) timervector[2]();
94 - if (TDCON & 0x00038000) timervector[3]();
 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]();
9595 }
9696
9797 static void (* dmavector[])(void) IDATA_ATTR =
Index: embios/trunk/target/ipodnano3g/interrupt.c
@@ -131,14 +131,13 @@
132132 void INT_TIMER(void) ICODE_ATTR;
133133 void INT_TIMER()
134134 {
135 - if (TACON & 0x00038000) timervector[0]();
136 - if (TBCON & 0x00038000) timervector[1]();
137 - if (TCCON & 0x00038000) timervector[2]();
138 - if (TDCON & 0x00038000) timervector[3]();
139 - if (TECON & 0x00038000) timervector[4]();
140 - if (TFCON & 0x00038000) timervector[5]();
141 - if (TGCON & 0x00038000) timervector[6]();
142 - if (THCON & 0x00038000) timervector[7]();
 135+ if (TACON & (TACON >> 4) & 0x7000) timervector[0]();
 136+ if (TBCON & (TBCON >> 4) & 0x7000) timervector[1]();
 137+ if (TCCON & (TCCON >> 4) & 0x7000) timervector[2]();
 138+ if (TDCON & (TDCON >> 4) & 0x7000) timervector[3]();
 139+ if (TFCON & (TFCON >> 4) & 0x7000) timervector[5]();
 140+ if (TGCON & (TGCON >> 4) & 0x7000) timervector[6]();
 141+ if (THCON & (THCON >> 4) & 0x7000) timervector[7]();
143142 }
144143
145144 static void (* dmavector[])(void) IDATA_ATTR =
Index: embios/trunk/target/ipodnano4g/interrupt.c
@@ -131,14 +131,13 @@
132132 void INT_TIMER(void) ICODE_ATTR;
133133 void INT_TIMER()
134134 {
135 - if (TACON & 0x00038000) timervector[0]();
136 - if (TBCON & 0x00038000) timervector[1]();
137 - if (TCCON & 0x00038000) timervector[2]();
138 - if (TDCON & 0x00038000) timervector[3]();
139 - if (TECON & 0x00038000) timervector[4]();
140 - if (TFCON & 0x00038000) timervector[5]();
141 - if (TGCON & 0x00038000) timervector[6]();
142 - if (THCON & 0x00038000) timervector[7]();
 135+ if (TACON & (TACON >> 4) & 0x7000) timervector[0]();
 136+ if (TBCON & (TBCON >> 4) & 0x7000) timervector[1]();
 137+ if (TCCON & (TCCON >> 4) & 0x7000) timervector[2]();
 138+ if (TDCON & (TDCON >> 4) & 0x7000) timervector[3]();
 139+ if (TFCON & (TFCON >> 4) & 0x7000) timervector[5]();
 140+ if (TGCON & (TGCON >> 4) & 0x7000) timervector[6]();
 141+ if (THCON & (THCON >> 4) & 0x7000) timervector[7]();
143142 }
144143
145144 static void (* dmavector[])(void) IDATA_ATTR =