AW: [En-Nut-Discussion] getch for Ethernut

Oliver Schulz Oliver.Schulz at bong.de
Tue May 18 11:56:02 CEST 2004


Hi Jörg,

As far as I know, getch() is also a blocking function. 
But you need some kind of kbhit() function to test, whether there is at least one character in receive buffer, but that is currently not supported.

If I need an user interface via stdin, I use a extra thread just to read the characters from stdin and store them in a global buffer. So it's very easy for other threads to check, whether there are some inputs or not.

Regards,
Oliver.




-----Ursprüngliche Nachricht-----
Von: en-nut-discussion-bounces at egnite.de [mailto:en-nut-discussion-bounces at egnite.de]Im Auftrag von Joerg.Lamprecht at kendro.spx.com
Gesendet: Dienstag, 18. Mai 2004 10:28
An: en-nut-discussion at egnite.de
Betreff: [En-Nut-Discussion] getch for Ethernut



Hello, 

I looking for an euquivalent for the C std. func. getch. 
So I need that because fgetc and all the other i/o get hung when waiting for a char. 
Is there any possibiltiy to set a timeout for fgetc. I tried the UART I/O Control Function _ioctl with the Command 
Code UART_SETREADTIMEOUT to 100 ms, but my Thread doesnt interrupt. 

Greetings from Jörg



More information about the En-Nut-Discussion mailing list