Fix red-- it should.
git-svn-id: svn://svn.rockbox.org/rockbox/trunk@18894 a1c6a512-1295-4272-9138-f99709370657
diff --git a/firmware/export/kernel.h b/firmware/export/kernel.h
index 9438f6d..beba58e 100644
--- a/firmware/export/kernel.h
+++ b/firmware/export/kernel.h
@@ -191,8 +191,24 @@
/* 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_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
diff --git a/uisimulator/sdl/kernel-sdl.c b/uisimulator/sdl/kernel-sdl.c
index 3a1d82b..2ff18b3 100644
--- a/uisimulator/sdl/kernel-sdl.c
+++ b/uisimulator/sdl/kernel-sdl.c
@@ -42,8 +42,6 @@
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 @@
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;