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 agoinstead 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