Re: Safe way to write interrupt driven circular buffer tx rx?



On Aug 29, 8:21 am, "Sven" <S...@xxxxxxx> wrote:
Can someone point out source code for a safe circular buffer receiver
transmitter? It's for sending and receiving bytes via RS232.

What I do is let the interrupt process freely modify the buffer count
& head variables.

The interruptible process modifies the buffer variables in only one
small block of code, which is bracketed with interrupt disable &
enable instructions.

Even if your UART only offers a simple result register for the
receive, you should be able to execute the non-interruptible section,
and then the interrupt, fast enough to not miss data at 115200 baud.

.