All of lore.kernel.org
 help / color / mirror / Atom feed
From: Gilles Chanteperdrix <gilles.chanteperdrix@xenomai.org>
To: Antoine Nourry <nourry@domain.hid>
Cc: xenomai@xenomai.org
Subject: Re: [Xenomai-help] Keyboard IRQ
Date: Thu, 26 Mar 2009 23:55:50 +0100	[thread overview]
Message-ID: <49CC07F6.7000100@domain.hid> (raw)
In-Reply-To: <49CC0687.2070509@domain.hid>

Antoine Nourry wrote:
> Gilles Chanteperdrix a écrit :
>> Antoine Nourry wrote:
>>
>>   
>>> I neither understand, is there a way to measure precisely the absolute 
>>> time of a keypress event on our computers ?
>>>     
>> Well, you can wait for the event in a user-space program, and use Linux
>> plain gettimeofday. It will probably give you more than enough precision.
>>
>>   
> Ok, i already made such programs but i thought that my polling method to 
> detect key event was bad and may consume too much time.

Well, you have to set the terminal to raw mode, and wait for a one
character read to return, then call gettimeofday. But you will have to
check in books or other lists for the shortest way to wait for a
character, I will not pretend to know this.

> Moreover aren't there any risks of being preempted or slowed by other
tasks ?

Not if you give your task a real-time priority. Which you were going to
do by using xenomai anyway.

-- 
					    Gilles.



      reply	other threads:[~2009-03-26 22:55 UTC|newest]

Thread overview: 8+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2009-03-26 17:09 [Xenomai-help] Keyboard IRQ Antoine Nourry
2009-03-26 17:37 ` Gilles Chanteperdrix
2009-03-26 21:04   ` Antoine Nourry
2009-03-26 21:24     ` Gilles Chanteperdrix
2009-03-26 21:52       ` Antoine Nourry
2009-03-26 21:58         ` Gilles Chanteperdrix
2009-03-26 22:49           ` Antoine Nourry
2009-03-26 22:55             ` Gilles Chanteperdrix [this message]

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=49CC07F6.7000100@domain.hid \
    --to=gilles.chanteperdrix@xenomai.org \
    --cc=nourry@domain.hid \
    --cc=xenomai@xenomai.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 an external index of several public inboxes,
see mirroring instructions on how to clone and mirror
all data and code used by this external index.