wizard97 / arduinoringbuffer Goto Github PK
View Code? Open in Web Editor NEWA Simple Interrupt Safe Ring (Circular) Buffer Queuing Library for Programming with Arduino's and other Embedded platforms
License: MIT License
A Simple Interrupt Safe Ring (Circular) Buffer Queuing Library for Programming with Arduino's and other Embedded platforms
License: MIT License
Is there a plan to add support for the SAMD arduinos? Perhaps integrating your SimplyAtomic library with this one?
I've been playing with the RingBuf library and had it working nicely on an Uno. I then compiled it for the ESP8266 and got this error: 'invalid conversion from 'void*' to 'int*' [-fpermissive]'
I think these would be the pertinent lines...
RingBuf *sensor1 = RingBuf_new(sizeof(unsigned int), HISTORICAL_ARRAY_SIZE);
int *data_ptr;
data_ptr = sensor1->peek(sensor1, i); ////// this is where it errors out
I've tried versions 1,2 and 3 all with the same results
Hi,
this is exactly what I would need in an ESP32 project, but the library is only targeted for AVR and ESP8266. I played a bit with the header file, but it is not a trivial change (for me). Any chance for ESP32 support ?
For AVR 8 bit you need to introduce some atomicity locking of the ring buffer. Otherwise subtle runtime nightmares...
Take a look at Dean Camera's solution in LUFA "ringBuffer.h"using the AVR libc tools in <util/atomic.h> as the right way to provide atomic protection.
Cheers, Phillip
Hi there,
I was hoping to use your library on the ESP8266, but I get the following error:
...snip...
WARNING: library RingBuf claims to run on [avr] architecture(s) and may be incompatible with your current board which runs on [esp8266] architecture(s).
C:\Users\blark\Documents\Arduino\libraries\RingBuf\RingBuf.c:9:25: fatal error: util/atomic.h: No such file or directory
#include <util/atomic.h>
...snip...
I took a look and it seems that atomic operations are possible on the ESP8266 (http://www.esp8266.com/viewtopic.php?f=9&t=618) however atomic.h is not implemented. Probably some wifi-related reason. Is there any hope of getting the code working on this platform?
Thank you for the great work! I'm just starting to do some development using this library, and so far so good ... except ... :-)
I'm wanting to use peek() to look at the next element to be pulled from the queue ... but it requires a num ... and I don't know what that num is? I can fetch the numelements() but that doesn't give it to me either.
Is there a way to find out what the "first" or "head" num is? And in that case the "last" or "tail" might be useful also?
Test cases are needed to validate changes to the library. Really want to merge the dev branch into master, but need to ensure there are no bugs.
Any commits that address this will be really appreciated! :)
I'm curious if there is a way to add an option to add(), or a new call (push()?) that would always add to the queue by "pushing" the oldest item out of the queue?
In the current implementation it appears that if we are adding and the buffer fills, we are forced to lose the "new" items. This works in two of our cases, but we have one where we want the "oldest" data to be lost so that the queue contains the latest {x} records.
Does this make sense? Thoughts?
A declarative, efficient, and flexible JavaScript library for building user interfaces.
๐ Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.
TypeScript is a superset of JavaScript that compiles to clean JavaScript output.
An Open Source Machine Learning Framework for Everyone
The Web framework for perfectionists with deadlines.
A PHP framework for web artisans
Bring data to life with SVG, Canvas and HTML. ๐๐๐
JavaScript (JS) is a lightweight interpreted programming language with first-class functions.
Some thing interesting about web. New door for the world.
A server is a program made to process requests and deliver data to clients.
Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.
Some thing interesting about visualization, use data art
Some thing interesting about game, make everyone happy.
We are working to build community through open source technology. NB: members must have two-factor auth.
Open source projects and samples from Microsoft.
Google โค๏ธ Open Source for everyone.
Alibaba Open Source for everyone
Data-Driven Documents codes.
China tencent open source team.