diff options
author | Keith Packard <keithp@keithp.com> | 2012-10-24 23:50:55 -0700 |
---|---|---|
committer | Keith Packard <keithp@keithp.com> | 2012-10-25 00:07:14 -0700 |
commit | b49c751749dcd3e78991463c098f8d916f52179d (patch) | |
tree | edb44fa67b8458b4bcb7928d122ffcf291b00107 /src/stm/ao_timer.c | |
parent | 4b13d3c659240e5a8347b1ba7ab0bf1d8355eba3 (diff) |
altos: Add task queues.
This replaces the array-based scheduler with a queue-based one
instead. It should have the same basic scheduling semantics, but it
walks shorter lists for each operation, making it much more efficient
when the system has a lot of tasks.
Signed-off-by: Keith Packard <keithp@keithp.com>
Diffstat (limited to 'src/stm/ao_timer.c')
-rw-r--r-- | src/stm/ao_timer.c | 4 |
1 files changed, 4 insertions, 0 deletions
diff --git a/src/stm/ao_timer.c b/src/stm/ao_timer.c index d82a803e..d69035f8 100644 --- a/src/stm/ao_timer.c +++ b/src/stm/ao_timer.c @@ -16,6 +16,7 @@ */ #include "ao.h" +#include <ao_task.h> volatile __data AO_TICK_TYPE ao_tick_count; @@ -42,6 +43,9 @@ void stm_tim6_isr(void) if (stm_tim6.sr & (1 << STM_TIM67_SR_UIF)) { stm_tim6.sr = 0; ++ao_tick_count; +#if HAS_TASK_QUEUE + ao_task_check_alarm((uint16_t) ao_tick_count); +#endif #if AO_DATA_ALL if (++ao_data_count == ao_data_interval) { ao_data_count = 0; |