+extern volatile __data uint8_t ao_data_present;
+extern volatile __data uint8_t ao_data_count;
+
+/*
+ * Mark a section of data as ready, check for data complete
+ */
+#define AO_DATA_PRESENT(bit) do { \
+ if ((ao_data_present |= (bit)) == AO_DATA_ALL) { \
+ ao_data_ring[ao_data_head].tick = ao_tick_count; \
+ ao_data_head = ao_data_ring_next(ao_data_head); \
+ ao_data_present = 0; \
+ ao_wakeup((void *) &ao_data_head); \
+ } \
+ } while (0);
+
+/*
+ * Wait for data to be completed by looking at the
+ * indicated bit
+ */
+#define AO_DATA_WAIT() do { \
+ ao_sleep((void *) &ao_data_count); \
+ } while (0)
+