summaryrefslogtreecommitdiff
path: root/src/kernel/ao.h
diff options
context:
space:
mode:
authorKeith Packard <keithp@keithp.com>2016-04-25 18:48:47 -0400
committerKeith Packard <keithp@keithp.com>2016-04-25 18:48:47 -0400
commit27319e4edbc503f193475b437fa5fe2937d47cbe (patch)
treeec123c1035b007a3dcc64518ff9bb92ede2ebcff /src/kernel/ao.h
parent7c9a111ac1c88467ce28e03b4a9d3eabc9d7015b (diff)
altos/stm32l: Add support for software-driven HW flow control
This allows applications to request that the flow control bits be driven from software rather than hardware, permitting more flexible pin configuration. Signed-off-by: Keith Packard <keithp@keithp.com>
Diffstat (limited to 'src/kernel/ao.h')
-rw-r--r--src/kernel/ao.h2
1 files changed, 2 insertions, 0 deletions
diff --git a/src/kernel/ao.h b/src/kernel/ao.h
index a794ba71..6ed0299e 100644
--- a/src/kernel/ao.h
+++ b/src/kernel/ao.h
@@ -820,6 +820,8 @@ struct ao_fifo {
} while(0)
#define ao_fifo_full(f) ((((f).insert + 1) & (AO_FIFO_SIZE-1)) == (f).remove)
+#define ao_fifo_mostly(f) ((((f).insert - (f).remove) & (AO_FIFO_SIZE-1)) >= (AO_FIFO_SIZE * 3 / 4))
+#define ao_fifo_barely(f) ((((f).insert - (f).remove) & (AO_FIFO_SIZE-1)) >= (AO_FIFO_SIZE * 1 / 4))
#define ao_fifo_empty(f) ((f).insert == (f).remove)
#if PACKET_HAS_MASTER || PACKET_HAS_SLAVE