Concept Flow - Ring buffer for UART receive
UART receives byte
next = (write_index + 1) % 4
if (next != read_index)
Discard byte
write_index = next
Read & process when ready
Repeat
This flow shows how bytes received from UART are stored in a ring buffer only if space available (next != read_index), handling wrap-around and overflow by discarding.