public inbox for linux-serial@vger.kernel.org
 help / color / mirror / Atom feed
From: "Sayang Oin" <sayangoin@hotmail.com>
To: linux-serial@vger.kernel.org
Subject: Re: interrupt programming
Date: Mon, 26 Jul 2004 09:24:42 +0200	[thread overview]
Message-ID: <BAY15-F21ZXn97cvZvK00022be7@hotmail.com> (raw)


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!


             reply	other threads:[~2004-07-26  7:24 UTC|newest]

Thread overview: 4+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2004-07-26  7:24 Sayang Oin [this message]
2004-07-26  8:08 ` interrupt programming Jan-Benedict Glaw
  -- strict thread matches above, loose matches on Subject: below --
2004-07-22 10:02 Sayang Oin
2004-07-22 12:20 ` Jan-Benedict Glaw

Reply instructions:

You may reply publicly to this message via plain-text email
using any one of the following methods:

* Save the following mbox file, import it into your mail client,
  and reply-to-all from there: mbox

  Avoid top-posting and favor interleaved quoting:
  https://en.wikipedia.org/wiki/Posting_style#Interleaved_style

* Reply using the --to, --cc, and --in-reply-to
  switches of git-send-email(1):

  git send-email \
    --in-reply-to=BAY15-F21ZXn97cvZvK00022be7@hotmail.com \
    --to=sayangoin@hotmail.com \
    --cc=linux-serial@vger.kernel.org \
    /path/to/YOUR_REPLY

  https://kernel.org/pub/software/scm/git/docs/git-send-email.html

* If your mail client supports setting the In-Reply-To header
  via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line before the message body.
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox