News for hackers. Stuff that matters.
Re:UART Receive Buffering by unwind on Friday June 12, 2015 @02:38AM (#9704371)
Yes, the ceremony to set up a ring buffer was confusing.

But isn't getchar() at least doing the same as before?

If the ring buffer is empty, ring_buffer_get() won't write to its data argument, and since getchar() passes in -1, that's what it's going to be returning if the buffer was empty. Just like it says it did before using a ring buffer.

There are no comments on this comment yet.