Skip to content

A simple ring buffer for ISR-task communication

Notifications You must be signed in to change notification settings

lamarrr/RingBuffer

Folders and files

NameName
Last commit message
Last commit date

Latest commit

 

History

10 Commits
 
 
 
 
 
 
 
 
 
 

Repository files navigation

RingBuffer

A ring/cyclic buffer suitable for ISR-Task communication

Ring Buffer, Source: Wikipedia

A C++ 17, templated and stack allocated ring buffer for continuous i/o.

Notes

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.

Dependencies

  • libstdc++17
  • libpthread
  • ninja
  • googletest (testing)

Running Tests

user@linux:~$ ninja tests.bin
user@linux:~$ ./tests.bin

Releases

No releases published

Packages

No packages published

Languages