Forum Discussion
Altera_Forum
Honored Contributor
20 years agoUART polling
Hello to everybody, I'm developing an application made by several task. I'd like to receive data from uart in asynchronous way. So I has a main loop that continuously execute some task and...
Altera_Forum
Honored Contributor
20 years ago --- Quote Start --- originally posted by ilan-g7@Feb 9 2006, 12:03 PM instead of using the file *
try using the next code
int fdterm;
int flags= o_rdwr | o_nonblock | o_noctty;
fdterm = open(uartname.c_str(),flags);
if(0==fdterm)
throw execption;
int len=read(fdterm,str,alt_avalon_uart_buf_len);
read will return 0 if there is nothing to read
<div align='right'><{post_snapback}> (index.php?act=findpost&pid=12654)
--- quote end ---
--- Quote End --- So i cannnot use gets() !! is it rigth ?