diff options
| author | Michael Sevakis <jethead71@rockbox.org> | 2008-10-27 16:30:24 +0000 |
|---|---|---|
| committer | Michael Sevakis <jethead71@rockbox.org> | 2008-10-27 16:30:24 +0000 |
| commit | a9e69d935cb5c2e5ffca1bbc977252ce7661d343 (patch) | |
| tree | 8ac65804b294cfe7cc55febe445f904a1b33cb0e /firmware/export/kernel.h | |
| parent | e5d72ac5f767a66b11c7a46dfb4edd322f7a723d (diff) | |
| download | rockbox-a9e69d935cb5c2e5ffca1bbc977252ce7661d343.zip rockbox-a9e69d935cb5c2e5ffca1bbc977252ce7661d343.tar.gz rockbox-a9e69d935cb5c2e5ffca1bbc977252ce7661d343.tar.bz2 rockbox-a9e69d935cb5c2e5ffca1bbc977252ce7661d343.tar.xz | |
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
Diffstat (limited to 'firmware/export/kernel.h')
| -rw-r--r-- | firmware/export/kernel.h | 12 |
1 files changed, 12 insertions, 0 deletions
diff --git a/firmware/export/kernel.h b/firmware/export/kernel.h index 51eb635..9438f6d 100644 --- a/firmware/export/kernel.h +++ b/firmware/export/kernel.h @@ -207,6 +207,18 @@ 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 |