Fix red-- it should.
git-svn-id: svn://svn.rockbox.org/rockbox/trunk@18894 a1c6a512-1295-4272-9138-f99709370657
This commit is contained in:
parent
a9e69d935c
commit
623cd1cb0d
2 changed files with 20 additions and 28 deletions
|
@ -191,8 +191,24 @@ struct wakeup
|
|||
/* We don't enable interrupts in the iPod bootloader, so we need to fake
|
||||
the current_tick variable */
|
||||
#define current_tick (signed)(USEC_TIMER/10000)
|
||||
|
||||
static inline void call_tick_tasks(void)
|
||||
{
|
||||
}
|
||||
#else
|
||||
extern volatile long current_tick;
|
||||
|
||||
/* inline helper for implementing target interrupt handler */
|
||||
static inline void call_tick_tasks(void)
|
||||
{
|
||||
extern void (*tick_funcs[MAX_NUM_TICK_TASKS+1])(void);
|
||||
int i;
|
||||
|
||||
current_tick++;
|
||||
|
||||
for (i = 0; tick_funcs[i] != NULL; i++)
|
||||
tick_funcs[i]();
|
||||
}
|
||||
#endif
|
||||
|
||||
#ifdef SIMULATOR
|
||||
|
@ -207,18 +223,6 @@ int tick_add_task(void (*f)(void));
|
|||
int tick_remove_task(void (*f)(void));
|
||||
extern void tick_start(unsigned int interval_in_ms);
|
||||
|
||||
/* inline helper for implementing target interrupt handler */
|
||||
static inline void call_tick_tasks(void)
|
||||
{
|
||||
extern void (*tick_funcs[MAX_NUM_TICK_TASKS+1])(void);
|
||||
int i;
|
||||
|
||||
current_tick++;
|
||||
|
||||
for (i = 0; tick_funcs[i] != NULL; i++)
|
||||
tick_funcs[i]();
|
||||
}
|
||||
|
||||
struct timeout;
|
||||
|
||||
/* timeout callback type
|
||||
|
|
|
@ -42,8 +42,6 @@ static int interrupt_level = HIGHEST_IRQ_LEVEL;
|
|||
static int handlers_pending = 0;
|
||||
static int status_reg = 0;
|
||||
|
||||
extern void (*tick_funcs[MAX_NUM_TICK_TASKS])(void);
|
||||
|
||||
/* Nescessary logic:
|
||||
* 1) All threads must pass unblocked
|
||||
* 2) Current handler must always pass unblocked
|
||||
|
@ -129,26 +127,16 @@ Uint32 tick_timer(Uint32 interval, void *param)
|
|||
|
||||
if(new_tick != current_tick)
|
||||
{
|
||||
long t;
|
||||
for(t = new_tick - current_tick; t > 0; t--)
|
||||
while(current_tick < new_tick)
|
||||
{
|
||||
int i;
|
||||
|
||||
sim_enter_irq_handler();
|
||||
|
||||
/* Run through the list of tick tasks */
|
||||
for(i = 0;i < MAX_NUM_TICK_TASKS;i++)
|
||||
{
|
||||
if(tick_funcs[i])
|
||||
{
|
||||
tick_funcs[i]();
|
||||
}
|
||||
}
|
||||
/* Run through the list of tick tasks - increments tick
|
||||
* on each iteration. */
|
||||
call_tick_tasks();
|
||||
|
||||
sim_exit_irq_handler();
|
||||
}
|
||||
|
||||
current_tick = new_tick;
|
||||
}
|
||||
|
||||
return 1;
|
||||
|
|
Loading…
Reference in a new issue