-#else
- {
- __pdata uint8_t ao_last_task_index = ao_cur_task_index;
- for (;;) {
- ++ao_cur_task_index;
- if (ao_cur_task_index == ao_num_tasks)
- ao_cur_task_index = 0;
-
- ao_cur_task = ao_tasks[ao_cur_task_index];
-
- /* Check for ready task */
- if (ao_cur_task->wchan == NULL)
- break;
-
- /* Check if the alarm is set for a time which has passed */
- if (ao_cur_task->alarm &&
- (int16_t) (ao_time() - ao_cur_task->alarm) >= 0)
- break;
-
- /* Wait for interrupts when there's nothing ready */
- if (ao_cur_task_index == ao_last_task_index && !ao_task_minimize_latency)
- ao_arch_wait_interrupt();
- }
- }
-#endif