Compare commits
No commits in common. "68af34c42869248860238a5edfed51879ffe7d21" and "41f817fd5b7d3f9adbb9ce47c511d95fd1f7b7b8" have entirely different histories.
68af34c428
...
41f817fd5b
3 changed files with 3 additions and 20 deletions
1
Makefile
1
Makefile
|
@ -10,7 +10,6 @@ ifneq ($(DEBUG), 1)
|
||||||
CFLAGS += -fno-exceptions -fno-asynchronous-unwind-tables -fno-ident
|
CFLAGS += -fno-exceptions -fno-asynchronous-unwind-tables -fno-ident
|
||||||
CFLAGS += -fno-unwind-tables -fno-stack-protector -fno-plt -fno-pic
|
CFLAGS += -fno-unwind-tables -fno-stack-protector -fno-plt -fno-pic
|
||||||
CFLAGS += -O3 -std=c99 -march=native -mtune=native -fomit-frame-pointer
|
CFLAGS += -O3 -std=c99 -march=native -mtune=native -fomit-frame-pointer
|
||||||
CFLAGS += -fshort-enums
|
|
||||||
else
|
else
|
||||||
CFLAGS += -g -O0 -std=c99 -march=native -mtune=native
|
CFLAGS += -g -O0 -std=c99 -march=native -mtune=native
|
||||||
CFLAGS += -DDEBUG
|
CFLAGS += -DDEBUG
|
||||||
|
|
20
ringbuf.h
20
ringbuf.h
|
@ -25,24 +25,8 @@ 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 */
|
||||||
* Considerations: One hot encoding for the enum values
|
enum ReadResult { Empty, ReadOk }; /** Result of a read */
|
||||||
* (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…
Add table
Reference in a new issue