ao_check_stack();
}
-void
+static void
ao_alarm(uint16_t delay)
{
#if HAS_TASK_QUEUE
#endif
}
-void
+static void
ao_clear_alarm(void)
{
#if HAS_TASK_QUEUE
#endif
}
+uint8_t
+ao_sleep_for(__xdata void *wchan, uint16_t timeout)
+{
+ uint8_t ret;
+ if (timeout)
+ ao_alarm(timeout);
+ ret = ao_sleep(wchan);
+ if (timeout)
+ ao_clear_alarm();
+ return ret;
+}
+
static __xdata uint8_t ao_forever;
void
ao_delay(uint16_t ticks)
{
- ao_alarm(ticks);
- ao_sleep(&ao_forever);
- ao_clear_alarm();
+ ao_sleep_for(&ao_forever, ticks);
}
void