Code Monkey home page Code Monkey logo

arduinoringbuffer's People

Contributors

maxgerhardt avatar per1234 avatar scls19fr avatar wizard97 avatar

Stargazers

 avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar

Watchers

 avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar

arduinoringbuffer's Issues

Issues compiling for ESP8266 with Arduino IDE

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

ESP32 support

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 ?

Atomicity locking.

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

Compatibility with ESP8266?

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?

peek() at head or tail?

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 - Help Wanted!

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! :)

add() (or new push()) that overwrites oldest?

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?

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    ๐Ÿ–– Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. ๐Ÿ“Š๐Ÿ“ˆ๐ŸŽ‰

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google โค๏ธ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.