fifo_write

Description

This function will try to write a byte to the FIFO. Data written to the FIFO will be added to the end of any data already in the FIFO.

The order in which data is written to and read from a FIFO is strictly preserved and is refered to as first in first out order.

Definition

byte fifo_write(FIFO *fifo, char ch)

Library

LIB/fifo_lib.bas

Usage

	char	ch

	byte	res

	res = fifo_write(&xfifo, ch)

	if res == 0 then
		// ch was successfully written to the FIFO

		do_something_because_ch_written_to_fifo()

	else
		// the FIFO is full and ch was not written to it

		do_something_because_fifo_full()
	endif
On entry:
fifo is a pointer to a FIFO or an array initalised for use as a FIFO.
ch is the 8 bit value to add to fifo
On exit:
This function will return fifo_ok if ch is successfully written to fifo otherwise it will return fifo_error.