Forum Discussion
Altera_Forum
Honored Contributor
16 years agoProblem with non-blocking UART I/O
Hi guys, I'm struggling with non-blocking UART (RS-232) I/O these days. I'm using the 9.1 suite with Software Build Tools for Eclipse, but it seems that the very same problem was also in previ...
Altera_Forum
Honored Contributor
14 years agoI think the altera_avalon_uart_read.c module has a bug in the handling of read in the high-speed driver.
the very end of altera_avalon_uart_read() is ... /* Return the number of bytes read */ if(read_would_block) { return ~EWOULDBLOCK; } else { return count; } I think that instead of the 1's compliment of EWOULDBLOCK that it should be returning the 2's compliment (negative) value. The return value of this function (if negative) gets negated (made positive) and stuffed in ALT_ERRNO. The result of retuning ~EWOULDBLOCK is that ALT_ERRNO gets 12 or ENOMEM and not EWOULDBLOCK.