[En-Nut-Discussion] UART-Polling
urbi
Urban.Battaglia at ch.TRUMPF.com
Wed May 20 08:43:45 CEST 2009
Hello,
For polling you can test the buffer length:
cnt = _filelength(_fileno(input));
if (cnt>0)
{
fread(....);
}
In this way you have a non blocking function.
Regards
Urban
Martin Walda wrote:
>
> Hello,
>
> I use an Ethernut 2.1 Rev B Board with an ATMega 128 controller.
>
> My question is, how can I poll data from the uart interface? I have tried
> fread, fgets and _read. All these functions seems to wait for incomming
> character's. I am searching for a non blocking function.
>
> Thank you very much
>
> Martin
>
>
>
>
> ______________________________________________________________________________
>
> SMA Solar Technology AG
> Aufsichtsrat: Dr. Erik Ehrentraut (Vorsitzender)
> Vorstand: Guenther Cramer, Peter Drews, Pierre-Pascal Urbon, Reiner
> Wettlaufer
> Handelsregister: Amtsgericht Kassel HRB 3972
> Sitz der Gesellschaft: 34266 Niestetal
> USt-ID-Nr. DE 113 08 59 54
> WEEE-Reg.-Nr. DE 95881150
> ______________________________________________________________________________
>
> _______________________________________________
> http://lists.egnite.de/mailman/listinfo/en-nut-discussion
>
>
--
View this message in context: http://www.nabble.com/UART-Polling-tp23599077p23629917.html
Sent from the MicroControllers - Ethernut mailing list archive at Nabble.com.
More information about the En-Nut-Discussion
mailing list