forked from len0rd/rockbox
Strange little kernel optimization to ease targeting the timer tick and to limit the number of loops in the tick function to the number of tasks added rather than always looping the max number.
git-svn-id: svn://svn.rockbox.org/rockbox/trunk@18893 a1c6a512-1295-4272-9138-f99709370657
This commit is contained in:
parent
e5d72ac5f7
commit
a9e69d935c
8 changed files with 37 additions and 126 deletions
|
|
@ -46,25 +46,12 @@ void __timer_unregister(void)
|
|||
|
||||
|
||||
/* Timer interrupt processing - all timers (inc. tick) have a single IRQ */
|
||||
|
||||
extern void (*tick_funcs[MAX_NUM_TICK_TASKS])(void);
|
||||
|
||||
void TIMER0(void)
|
||||
{
|
||||
if (TIREQ & TF0) /* Timer0 reached ref value */
|
||||
{
|
||||
int i;
|
||||
|
||||
/* Run through the list of tick tasks */
|
||||
for(i = 0; i < MAX_NUM_TICK_TASKS; i++)
|
||||
{
|
||||
if(tick_funcs[i])
|
||||
{
|
||||
tick_funcs[i]();
|
||||
}
|
||||
}
|
||||
|
||||
current_tick++;
|
||||
call_tick_tasks();
|
||||
|
||||
/* reset Timer 0 IRQ & ref flags */
|
||||
TIREQ |= TI0 | TF0;
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue