Join GitHub today
GitHub is home to over 50 million developers working together to host and review code, manage projects, and build software together.
Sign upAdd generic byte RingBuffer class #8
Conversation
facchinm
commented
Jul 1, 2016
|
The data provided from gyroscope has no sense without timing information. This means that a correct FIFO or rate-limiting must be implemented from the sub-class. Close #1
This comment has been minimized.
This comment has been minimized.
This is a very minor point, but what about calling this setTimeProvider()? |
it's now implicit from general API version
* cloned from samd core * implement addStorage() API to allow static/dynamic size increase
Does this code depend upon SAMD's atomic access to "int" type? |
Hi Paul, |
Agreed, disabling interrupts probably adds too much overhead. Using more than 8 bits for the head and tail index probably also slows the code too much on AVR. I'd recommend something like this, and in the documentation mention the maximum total buffer size is limited to 256 bytes on AVR.
I do believe this feature will make a lot of people very happy, even if the total size is restricted to 256 bytes on AVR chips. Any idea what the user-visible API will be in the HardwareSerial class? RingBuffer is meant to remain private, right? |
On AVR, RingBuffer::addStorage() would also need to check the _size parameter to limit to the maximum. |
Was any decision or proposal ever made for the public API for sketches? Would addStorage() also be in the HardwareSerial object? Or would it be 2 different function names, one for adding to the read buffer and another for writing? I'd like to try implementing this. Is that ok? Obviously the last thing I want is to publish anything which needs to be kept confidential, or to end up causing compatibility problems. |
I'd leave a single (generic) function in RingBuffer class while specializing in classes using it (like |
Perhaps the words "Read" and "Write" would be more consistent than "Tx" and "Rx", with the rest of the Arduino API?
So it's ok to discuss on the public developer list? This is a private area, so I'm always like to double check before posting anything in public. |
@facchinm I believe we can close this one? Looks like ancient history |