A simple ring buffer for ISR-task communication
A ring/cyclic buffer suitable for ISR-Task communication
A C++ 17, templated and stack allocated ring buffer for continuous i/o.
Instead of releasing old data, you handle the buffer overrun.
To use with an RTOS, ensure there is a semaphore lock before calling ReadNext until an IRQ that calls WriteNext to the ring buffer occurs and releases the semaphore lock for reading.
user@linux:~$ ninja tests.bin
user@linux:~$ ./tests.bin