Forum Discussion
Altera_Forum
Honored Contributor
22 years agoNios II, nonblocking i/o, anyone
Does anyone know how to implement a nonblocking input function on the jtag uart on NiosII ? On Nios I used nr_rxchar(), which returns even if there is no character waiting. The suggested r...
Altera_Forum
Honored Contributor
22 years agoJust found a way:
// Open the device as nonblocking console_io_fi=open("/dev/uart_0",O_RDWR|O_NONBLOCK|O_NOCTTY|O_SYNC); // i returns the number of characters read i=read(console_io_fi,&ch,1); I spent some time before I realized that the terminal window integrated in the IDE does not send anything until you hit CR. -So I had to use RS232 instead.