Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

DMA ringbuffer fills only half the buffer #12

Open
vincent-esperance opened this issue Feb 27, 2016 · 1 comment
Open

DMA ringbuffer fills only half the buffer #12

vincent-esperance opened this issue Feb 27, 2016 · 1 comment
Labels

Comments

@vincent-esperance
Copy link

Hi,

If you try the DMA ringbuffer with the Teensy 3.1, it does not work as expected : only half the buffer is filled, I think that the correction needs to be done on line 85, you should have 2 * b_size for the second argument which I believe is in bytes, the comment is already pointing to that possible issue

dmaChannel->destinationCircular((uint16_t_)p_elems, 2 * b_size); // 2_b_size is necessary for some reason

There is a side effect if you set this to 2 * b_size, the IsFull function as written now detect the half-full condition .. I am not completely clear on how to use the IsEmpy and IsFull function, it would be more convenient to have a function telling you what is the present level of the buffer.

Anyway, the package is very interesting and usefull some comments could improve its usage

Yours
Vincent

@pedvide pedvide added the bug label Nov 19, 2016
@pedvide
Copy link
Owner

pedvide commented Nov 19, 2016

I'm rewriting the whole DMA thing. As you rightly point out it doesn't really work.
The new DMARingBuffer will be a ping pong buffer and the RingBuffer will be a software-only circular buffer.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
Projects
None yet
Development

No branches or pull requests

2 participants