This is the mail archive of the ecos-discuss@sourceware.org mailing list for the eCos project.


Index Nav: [Date Index] [Subject Index] [Author Index] [Thread Index]
Message Nav: [Date Prev] [Date Next] [Thread Prev] [Thread Next]
Other format: [Raw text]

Re: ping problem while scanf in progress


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


Index Nav: [Date Index] [Subject Index] [Author Index] [Thread Index]
Message Nav: [Date Prev] [Date Next] [Thread Prev] [Thread Next]