Function rc_ringbuf_insert#

Function Documentation#

int rc_ringbuf_insert(rc_ringbuf_t *buf, double val)#

Puts a new float into the ring buffer and updates the index accordingly.

If the buffer was full then the oldest value in the buffer is automatically removed.

Parameters:
  • buf – Pointer to user’s buffer

  • val[in] The value to be inserted

Returns:

Returns 0 on success or -1 on failure.