Description
This function initialises a block of RAM for subsequent use as a FIFO. FIFOs must be initialised before they are used.BEWARE: FIFOs are initialised by XCSB before use, do not use fifo_init unless you are creating FIFOs yourself dynamically.
Definition
fifo_init(ubyte *fifo, byte len)Library
LIB/fifo_lib.basUsage
On entry:// declare a global byte array for use as a FIFO ubyte xfifo[19] proc main() // initialise the array for use as a FIFO fifo_init(&xfifo, 16) // NOTE the array is declared as 19 bytes long // and the length of the fifo buffer is 16 bytes // the relationship between the delared array // and the size of the fifo is always // len = array_size - 3 endprocfifo is a pointer to an array to be used as a FIFO.On exit:
len is the number of bytes to be used as the fifo buffer.The FIFO occupies len+3 bytes of RAM so to use a FIFO of 16 bytes space must be reserved for 16+3 bytes.
There is no return value