projects
/
fw
/
altos
/ blobdiff
commit
grep
author
committer
pickaxe
?
search:
re
summary
|
shortlog
|
log
|
commit
|
commitdiff
|
tree
raw
|
inline
| side by side
Add .gitignore for ao-bringup
[fw/altos]
/
src
/
ao_task.c
diff --git
a/src/ao_task.c
b/src/ao_task.c
index 14aa84c841d698d3a285de7370c80de369c7b56f..4a78766e2828664b1687b09f0ea28a02ac987066 100644
(file)
--- a/
src/ao_task.c
+++ b/
src/ao_task.c
@@
-217,7
+217,10
@@
ao_wakeup(__xdata void *wchan)
void
ao_alarm(uint16_t delay)
{
void
ao_alarm(uint16_t delay)
{
- if (!(ao_cur_task->alarm = ao_time() + delay))
+ /* Make sure we sleep *at least* delay ticks, which means adding
+ * one to account for the fact that we may be close to the next tick
+ */
+ if (!(ao_cur_task->alarm = ao_time() + delay + 1))
ao_cur_task->alarm = 1;
}
ao_cur_task->alarm = 1;
}
@@
-228,7
+231,7
@@
ao_wake_task(__xdata struct ao_task *task)
}
void
}
void
-ao_exit(void)
+ao_exit(void)
__critical
{
uint8_t i;
ao_num_tasks--;
{
uint8_t i;
ao_num_tasks--;