Better enum docs, added errors related to *_many functions
This commit is contained in:
parent
8cbca38726
commit
8e77f810ec
1 changed files with 18 additions and 2 deletions
20
ringbuf.h
20
ringbuf.h
|
@ -25,8 +25,24 @@ struct RingBuf {
|
||||||
void *buffer_end; /** The end of the buffer */
|
void *buffer_end; /** The end of the buffer */
|
||||||
} __attribute__((packed));
|
} __attribute__((packed));
|
||||||
|
|
||||||
enum WriteResult { Full, WriteOk }; /** Result of a write */
|
/*
|
||||||
enum ReadResult { Empty, ReadOk }; /** Result of a read */
|
* Considerations: One hot encoding for the enum values
|
||||||
|
* (8 bit each with -fshort-enums)
|
||||||
|
*/
|
||||||
|
|
||||||
|
/** Result of a write */
|
||||||
|
enum WriteResult {
|
||||||
|
WriteOk, /** The write was successful */
|
||||||
|
Full, /** The buffer is full */
|
||||||
|
InsufficientSpace /** There is not enough space to write */
|
||||||
|
};
|
||||||
|
|
||||||
|
/** Result of a read */
|
||||||
|
enum ReadResult {
|
||||||
|
Empty, /** The buffer is empty */
|
||||||
|
ReadOk, /** The read was successful */
|
||||||
|
InsufficientData /** There is not enough data to read */
|
||||||
|
};
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* @brief Initialize the ring buffer
|
* @brief Initialize the ring buffer
|
||||||
|
|
Loading…
Reference in a new issue