|
ringbuffer
1.0.0
Platform-Agnostic Ring Buffer Implementation in C
|
There are a lot of ring buffer implementation in C over the internet. However, author cannot find the most portable and well tested for that implementation, especially for microcontroller. Other than learning reasons, the author wrote the implementation with some priorities:
After you installed the requirement, run this command to let CMake prepare the source code.
If you're developing a microcontroller software with Microchip, the preparation command is different. Follow this instead.
Replace <Model_Number> to your microcontroller's model number as example ATSAMC21E18A.
Special thanks to Sam Hanes to make this possible!
First of all, you need to get inside the build directory with cd command. Then run this:
That's it! Now, the build output is inside out directory.
libringbuffer.a is static librarylibringbuffer.so is dynamic-linking libraryringbuffer-test-integration to test the build output brieflyringbuffer-test-unit to test the build output in detaillibringbuffer.a is static librarylibringbuffer.dylib is dynamic-linking libraryringbuffer-test-integration to test the build output brieflyringbuffer-test-unit to test the build output in detailringbuffer.lib is static libraryringbuffer.dll is dynamic-linking libraryringbuffer-test-integration.exe to test the build output brieflyringbuffer-test-unit.exe to test the build output in detailIf you are using this project for POSIX-compliant platform including Linux-based operating system, follow the For POSIX-compliant OS guide. Otherwise, follow For non-POSIX platform. For Microchip platform, you just have to integrate this project to your project.
CMake made it easy, just go into build directory in this project with cd command then run this.
See the examples directory to figure out how to use this project.
This involves manual method, which requires you to copy include/ringbuffer.h file in this project to your source code and link either static library or dynamic-linking library. In Microsoft Visual Studio, see this guide.
If you can't successfully automate with CMake, copy the entire src and include directory to your project manually. It possibly work, but you can't use unit test and integration test in this repository for that platform. So the only way to test is trying on physical microcontroller.