Page 1 of 1

Circular buffer implementation

Posted: Mon Jan 07, 2019 10:05 am
by woju93
Hi All,

I have a task, I need to store the last n measurement (a struct) to a queue. I think so I need a circular buffer for this. Is there a component for this in esp?

thx,
Woju

Re: Circular buffer implementation

Posted: Mon Jan 07, 2019 11:39 am
by ESP_krzychb
Hi woju93,

Yes, there is a ringbuffer component in ESP-IDF together with detailed documentation.

Re: Circular buffer implementation

Posted: Mon Jan 07, 2019 12:56 pm
by woju93
Hi Krzychb,

Are you sure is it good for me?
I will never get an element from this buffer. I always put items to this, and I need to read whole queue because it is a statistics for the last n events.

thx,
woju