项目作者: lamarrr

项目描述 :
A simple ring buffer for ISR-task communication
高级语言: C++
项目地址: git://github.com/lamarrr/RingBuffer.git
创建时间: 2019-07-26T17:13:32Z
项目社区:https://github.com/lamarrr/RingBuffer

开源协议:

下载


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

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