aboutsummaryrefslogtreecommitdiffstats
path: root/libmaple/ring_buffer.h
diff options
context:
space:
mode:
Diffstat (limited to 'libmaple/ring_buffer.h')
-rw-r--r--libmaple/ring_buffer.h10
1 files changed, 5 insertions, 5 deletions
diff --git a/libmaple/ring_buffer.h b/libmaple/ring_buffer.h
index 9628005..b4c136f 100644
--- a/libmaple/ring_buffer.h
+++ b/libmaple/ring_buffer.h
@@ -14,14 +14,14 @@ extern "C"{
* The total buffer size must be a power of two
* One byte is left free to distinguish empty from full */
typedef struct ring_buffer {
+ /** Buffer items are stored into */
+ volatile uint8 *buf;
/** Index of the next item to remove */
- volatile uint32 head;
+ volatile uint16 head;
/** Index where the next item will get inserted */
- volatile uint32 tail;
+ volatile uint16 tail;
/** Buffer capacity */
- uint8 size;
- /** Buffer items are stored into */
- volatile uint8 *buf;
+ uint16 size;
} ring_buffer;
/** Initialise a ring buffer.