diff options
-rw-r--r-- | libraries/fifo.h | 48 |
1 files changed, 24 insertions, 24 deletions
diff --git a/libraries/fifo.h b/libraries/fifo.h index 700d2ec..1a77705 100644 --- a/libraries/fifo.h +++ b/libraries/fifo.h @@ -1,30 +1,30 @@ /* - FIFO Ring Buffer uint8_t array ring_buffer (example length is 8) - with data (x) and read and write index: - - --- --- --- --- --- --- --- --- - | | | x | x | x | | | | - --- --- --- --- --- --- --- --- - ^ ^ - | | - read_index | - write_index - - --- --- --- --- --- --- --- --- - | x | x | | | | x | x | x | - --- --- --- --- --- --- --- --- - ^ ^ - | | - write_index | - read_index - - - input data goes to position of write_index - - output data comes from read_index position - - after input/output operation the according index has to be modified - - according to the idea of ring buffers the write_index could be - smaller than the read_index + FIFO Ring Buffer uint8_t array ring_buffer (example length is 8) + with data (x) and read and write index: + + --- --- --- --- --- --- --- --- + | | | x | x | x | | | | + --- --- --- --- --- --- --- --- + ^ ^ + | | + read_index | + write_index + + --- --- --- --- --- --- --- --- + | x | x | | | | x | x | x | + --- --- --- --- --- --- --- --- + ^ ^ + | | + write_index | + read_index + + - input data goes to position of write_index + - output data comes from read_index position + - after input/output operation the according index has to be modified + - according to the idea of ring buffers the write_index could be + smaller than the read_index */ |