KIC8462852 EPIC204278916

Thoughts on data flow

Discussion created by KIC8462852 EPIC204278916 on Mar 30, 2017

Changing coding style can be sometime fun.

Here we have fun by using a circular buffer and use it as a linear data snake. You can add/remove an element from either the head or tail. You can be notified when the snake is created (from zero to one element) or removed (no more elements). This mecanism can generate a FIFO within a circulating buffer. A main loop can add elements while a USART can get elements within its IRQ. IRQ is disabled when no more elements are available and enabled when the first one is added.

Buffering between 2 serial interface can be done this way. Here to be generic, an element is represented by its pointer.


A fun project. Simple test function within the C code.