how to check UART Data buffer?

For questions and comments on programming in general. And for any items that don't fit into the forums below.

Moderators: Benj, Mods

Post Reply
rashisdk
Posts: 1
Joined: Tue Jun 19, 2018 11:30 am
Contact:

how to check UART Data buffer?

Post by rashisdk »

in C we can use this command to check Data in UART receive buffer is ready for reading,
" if (UART1 Data Ready () ==1 "
but how we can do this in flowcode??

User avatar
Benj
Matrix Staff
Posts: 15312
Joined: Mon Oct 16, 2006 10:48 am
Location: Matrix TS Ltd
Has thanked: 4803 times
Been thanked: 4314 times
Contact:

Re: how to check UART Data buffer?

Post by Benj »

Hello,
in C we can use this command to check Data in UART receive buffer is ready for reading,
I'm guessing this is from Arduino C.

The easiest way is to use a RX interrupt to put the data bytes into a circular buffer as it comes in. You can then poll the buffer as part of your main program. This way you get far more data buffering then the UART hardware can provide.

Here's an example.
https://www.matrixtsl.com/wiki/images/6 ... uffer.fcfx

Post Reply