spinn_common 7.2.2
Support code for SpiNNaker applications.
Loading...
Searching...
No Matches
Functions
circular_buffer.c File Reference

Support functions for fast circular buffer implementation. More...

#include "circular_buffer.h"
#include "utils.h"
#include "spin-print.h"

Functions

circular_buffer circular_buffer_initialize (uint32_t size)
 Create a new FIFO circular buffer of at least the given size. For efficiency, the buffer can be bigger than requested.
 
void circular_buffer_print_buffer (circular_buffer buffer)
 Print the contents of the buffer.
 

Detailed Description

Support functions for fast circular buffer implementation.

The essential feature of the buffer used in this implementation is that it requires no critical-section interlocking — PROVIDED THERE ARE ONLY TWO PROCESSES: a producer/consumer pair. If this is changed, then a more intricate implementation will probably be required, involving the use of enable/disable interrupts.

Author
Dave Lester (david.nosp@m..r.l.nosp@m.ester.nosp@m.@man.nosp@m.chest.nosp@m.er.a.nosp@m.c.uk)
Date
10 December, 2013

Function Documentation

◆ circular_buffer_initialize()

circular_buffer circular_buffer_initialize ( uint32_t  size)

Create a new FIFO circular buffer of at least the given size. For efficiency, the buffer can be bigger than requested.

Parameters
[in]sizeThe minimum number of elements in the buffer to be created
Returns
A reference to the created buffer.

◆ circular_buffer_print_buffer()

void circular_buffer_print_buffer ( circular_buffer  buffer)

Print the contents of the buffer.

Do not use if the sark IO_BUF is being used for binary data.

Parameters
[in]bufferThe buffer to print