This is the mail archive of the
ecos-discuss@sourceware.org
mailing list for the eCos project.
Re: ping problem while scanf in progress
- From: Andrew Lunn <andrew at lunn dot ch>
- To: Hakan ?akiroglu <ha_cakiroglu at hotmail dot com>
- Cc: ecos-discuss at ecos dot sourceware dot org
- Date: Tue, 29 Jan 2008 08:47:21 +0100
- Subject: Re: [ECOS] ping problem while scanf in progress
- References: <BLU122-W39DDAE159204C2BF1037CAFA350@phx.gbl>
On Tue, Jan 29, 2008 at 04:30:50AM +0000, Hakan ?akiroglu wrote:
>
> 1.
> int main()
> {
>
> init_all_network_interfaces();
> char xxx[20];
> printf("What is your name?");
> scanf("%s",xxx);
> .....
> .....
> ....
> .....
> }
>
>
> 2.
> int main()
> {
>
> init_all_network_interfaces();
> char xxx[20];
> printf("What is your name?");
> ......
> .......
> ......
> ......
>
>
> }
>
> I am running such a program in ram mode. I am using threads and program is not ending at the end.
> I am using net packages. Everything ok. my program is also working but
> Problem is this :
> In 2. example there is no problem. I can ping and ping replies to me all the time.
> But in 1. example while waiting entry from user with scanf I can not ping my machine. After that line (user
> enters something from keyboard and presses enter key)
> again I can ping.
> Has anybody faced such a thing before?? Or I am doing something wrong???
You are using the very simple HAL debug serial driver. This uses
blocking polled IO, not interrupts.
Enable the interrupt driver serial driver for your platform and use
that for I/O.
Andrew
--
Before posting, please read the FAQ: http://ecos.sourceware.org/fom/ecos
and search the list archive: http://ecos.sourceware.org/ml/ecos-discuss