Forum Discussion
Altera_Forum
Honored Contributor
21 years agoNios II UART Troubles
OK, I am porting some code from Nios 1 to Nios 2 and I am stuck on the UART code. Here is the original code: char poll_uart_rx( void )
{
int i;
i = nr_uart_rxchar( na_uart_0 );
if( ...
Altera_Forum
Honored Contributor
21 years agoI open device uart in non blocking mode:
static int fdterm; // FILEDESCRIPTOR RETURNED BY OPEN .. fdterm = open("/dev/uart1", O_RDWR | O_NONBLOCK | O_NOCTTY); .. reading is done by .. res=read(fdterm,uart1_tempbuff,sizeof(uart1_tempbuff)-1); if(res>0) { ... we have received some bytes }