https://github.com/thisisnotjustin/circular_buffer
Educational Circular (Ring) Buffer Implementation for Real-Time Systems
https://github.com/thisisnotjustin/circular_buffer
c embedded-systems
Last synced: 5 months ago
JSON representation
Educational Circular (Ring) Buffer Implementation for Real-Time Systems
- Host: GitHub
- URL: https://github.com/thisisnotjustin/circular_buffer
- Owner: ThisIsNotJustin
- Created: 2024-12-29T09:30:23.000Z (over 1 year ago)
- Default Branch: main
- Last Pushed: 2024-12-29T09:39:34.000Z (over 1 year ago)
- Last Synced: 2025-05-09T01:47:05.203Z (about 1 year ago)
- Topics: c, embedded-systems
- Language: C
- Homepage:
- Size: 1.95 KB
- Stars: 2
- Watchers: 1
- Forks: 0
- Open Issues: 0
-
Metadata Files:
- Readme: README.md
Awesome Lists containing this project
README
# Circular Buffer Implementation
This is a simple implementation of a circular (ring) buffer, allowing for efficient storage and retrieval of data in a fixed-size buffer. The circular buffer follows a FIFO principle, making it ideal for temporary data storage like in a real-time system/producer-consumer scenario.
## Features
- Fixed-size buffer: The buffer has a defined maximum capacity.
- Efficient Enqueue and Dequeue: Allows constant-time insertion and removal of data.
- Circular behavior: When the buffer reaches its maximum capacity, new elements overwrite the oldest ones.
- Error handling: Functions return error codes in cases like overflows or underflows.
- Simple API: Provides an easy-to-use interface for managing the buffer.