This is the mail archive of the
ecos-discuss@sources.redhat.com
mailing list for the eCos project.
Re: read com0 on e7t
- From: Bob Koninckx <bob dot koninckx at mech dot kuleuven dot ac dot be>
- To: F dot T dot Nilsson at hw dot ac dot uk
- Cc: ecoss discussion forum <ecos-discuss at sources dot redhat dot com>
- Date: 16 May 2003 14:27:58 +0200
- Subject: Re: [ECOS] read com0 on e7t
- Organization: KULeuven
- References: <1053087529.3ec4d72970d91@wmail2.hw.ac.uk>
Where does it block ? Isn't it just "waiting" for input to come in on
the serial interface, 'cause that would be normal behaviour. What
happens when data effectively comes in ?
Bob
On Fri, 2003-05-16 at 14:18, F.T.Nilsson@hw.ac.uk wrote:
> Hi,
>
> I have an application which reads on com0 on e7t and eventhoughthe message
> is a bit strang it works. However I want to poll com0 until a message is
> sent so I put the cyg_io_read(..) in a loop but the program hangs when
> entering this function (due to the loop).
>
> can anyone help me?
>
> cheers
>
> Fred
>
> static void poll_com0(CYG_ADDRESS data)//
> {
> Cyg_ErrNo err;
> printf("in poll_com0");
>
> char mybuff[100];
> cyg_uint32 len2 = strlen(mybuff);
>
> while(len2 == 0)
> {
> err= cyg_io_read(handle_ser0, mybuff , &len2 );
> len2 = strlen(mybuff);
> }
>
> if (ENOERR == err) {
> printf(" read on ser0\n");
> printf("Mybyff = %s\n", mybuff[0]);
> }
>
> }
> ________________________________________________________________
>
> DISCLAIMER:
>
> This e-mail and any files transmitted with it are confidential
> and intended solely for the use of the individual or entity to
> whom it is addressed. If you are not the intended recipient
> you are prohibited from using any of the information contained
> in this e-mail. In such a case, please destroy all copies in
> your possession and notify the sender by reply e-mail. Heriot
> Watt University does not accept liability or responsibility
> for changes made to this e-mail after it was sent, or for
> viruses transmitted through this e-mail. Opinions, comments,
> conclusions and other information in this e-mail that do not
> relate to the official business of Heriot Watt University are
> not endorsed by it.
> ________________________________________________________________
--
----------------------------------------------------------------------
ir. Bob Koninckx
Katholieke Universiteit Leuven
Division Production Engineering, tel. +32 16 322535
Machine Design and Automation fax. +32 16 322987
Celestijnenlaan 300B bob.koninckx@mech.kuleuven.ac.be
B-3001 Leuven Belgium http://www.mech.kuleuven.ac.be/pma
----------------------------------------------------------------------
--
Before posting, please read the FAQ: http://sources.redhat.com/fom/ecos
and search the list archive: http://sources.redhat.com/ml/ecos-discuss