[En-Nut-Discussion] Blocking UART calls

Harald Kipp harald.kipp at egnite.de
Tue Mar 11 10:38:11 CET 2003


Jens,

Guess, I got you wrong. _read() shouldn't block the
"whole system".

To avoid the calling thread being blocked, use

_ioctl(f, UART_SETREADTIMEOUT, &timeout);

for the UARTs or

NutTcpSetSockOpt(s, SO_RCVTIMEO, &timeout, sizeof(timeout));

for sockets.

Harald

At 21:26 10.03.2003 +0100, you wrote:
>Hi all,
>
>Due to the handling of uart and sockets with file
>descriptors it's easy to write software, that uses
>sockets and alternatively the AVR internal uart.
>Unfortunatley it seem's, that _read() calls to uart
>channels block the system, is that right ? Is there
>a way to avoid this behavior and allow background
>threads to work (i.e. serve the watchdog) ?
>
>Regards
>
>Jens
>
>
>_______________________________________________
>En-Nut-Discussion mailing list
>En-Nut-Discussion at egnite.de
>http://www.egnite.de/mailman/listinfo/en-nut-discussion




More information about the En-Nut-Discussion mailing list