Function rc_ringbuf_get_value#
Defined in File ring_buffer.h
Function Documentation#
-
double rc_ringbuf_get_value(rc_ringbuf_t *buf, int position)#
Fetches the float which is ‘position’ steps behind the last value added to the buffer.
If ‘position’ is given as 0 then the most recent value is returned. The position obviously can’t be larger than (buffer size - 1).
- Parameters:
buf – Pointer to user’s buffer
position – [in] steps back in the buffer to fetch the value from
- Returns:
Returns the requested float. Prints an error message and returns -1.0f on error.