I'm trying to use a circular buffer like the one mentioned in this post: https://stackoverflow.com/a/827749
When I need to push and pop things to the buffer I find myself doing something like this all the time:
int data;
int *data_ptr = &data;
cb_pop(spi_buffer, data_ptr);
Is this the best (probably not) way to do this? How would you do it?
Thanks