public inbox for linux-serial@vger.kernel.org
 help / color / mirror / Atom feed
* interrupt programming
@ 2004-07-22 10:02 Sayang Oin
  2004-07-22 12:20 ` Jan-Benedict Glaw
  0 siblings, 1 reply; 4+ messages in thread
From: Sayang Oin @ 2004-07-22 10:02 UTC (permalink / raw)
  To: linux-serial

Hello,

I've written a programm to communicate with a external UART device through 
/dev/ttyS0.
I use POSIX and Timer but unfortunately is not working well.

Is it possible to use Interrupt to read and write datas through the serial 
port?

I'm very thankfull for any hints

best regards
sayangoin

_________________________________________________________________
Wußten Sie, daß Sie Ihren Hotmail-Posteingang auch über den MSN Messenger 
abrufen können? http://www.msn.de/messenger Jetzt kostenlos downloaden und 
einfach testen!


^ permalink raw reply	[flat|nested] 4+ messages in thread
* Re: interrupt programming
@ 2004-07-26  7:24 Sayang Oin
  2004-07-26  8:08 ` Jan-Benedict Glaw
  0 siblings, 1 reply; 4+ messages in thread
From: Sayang Oin @ 2004-07-26  7:24 UTC (permalink / raw)
  To: linux-serial


Hallo,

I have to use timer because I have to communicate with other programm via 
filestream
and I use this timer also for scheduling the time that I have to send data 
to my device.

people said if I use interrupt so I can be sure I will not lose my datas.


here is my routine
....

  while(1)
  {
		res=select(fd+1, &rfds, NULL, NULL, &tv);
		if(res==0)
		{
		 tries++;
		 if(tries==8)
		  return 0;
		}

      		n = read (fd, p, 1);
		if(n>0)
		{

		 printf(" %X \n", buffer[rd]);
		 p++;
		 rd++;

		}

                // up here I analyze my datas.

                // if everythings ok I jump out of the while


  return rd;
}

....


best regards
sayangoin

_________________________________________________________________
Wußten Sie, daß Sie Ihren Hotmail-Posteingang auch über den MSN Messenger 
abrufen können? http://www.msn.de/messenger Jetzt kostenlos downloaden und 
einfach testen!


^ permalink raw reply	[flat|nested] 4+ messages in thread

end of thread, other threads:[~2004-07-26  8:08 UTC | newest]

Thread overview: 4+ messages (download: mbox.gz follow: Atom feed
-- links below jump to the message on this page --
2004-07-22 10:02 interrupt programming Sayang Oin
2004-07-22 12:20 ` Jan-Benedict Glaw
  -- strict thread matches above, loose matches on Subject: below --
2004-07-26  7:24 Sayang Oin
2004-07-26  8:08 ` Jan-Benedict Glaw

This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox