-static void
-ao_alarm(uint16_t delay)
-{
-#if HAS_TASK_QUEUE
- uint32_t flags;
- /* 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
- */
- flags = ao_arch_irqsave();
-#endif
- if (!(ao_cur_task->alarm = ao_time() + delay + 1))
- ao_cur_task->alarm = 1;
-#if HAS_TASK_QUEUE
- ao_task_to_alarm_queue(ao_cur_task);
- ao_arch_irqrestore(flags);
-#endif
-}
-
-static void
-ao_clear_alarm(void)
-{
-#if HAS_TASK_QUEUE
- uint32_t flags;
-
- flags = ao_arch_irqsave();
-#endif
- ao_cur_task->alarm = 0;
-#if HAS_TASK_QUEUE
- ao_task_from_alarm_queue(ao_cur_task);
- ao_arch_irqrestore(flags);
-#endif
-}
-