All of lore.kernel.org
 help / color / mirror / Atom feed
* [Xenomai-help] Keyboard IRQ
@ 2009-03-26 17:09 Antoine Nourry
  2009-03-26 17:37 ` Gilles Chanteperdrix
  0 siblings, 1 reply; 8+ messages in thread
From: Antoine Nourry @ 2009-03-26 17:09 UTC (permalink / raw)
  To: xenomai

Hi,
i need to catch a key press as soon as it is released. What is the best 
solution ?
I tried to catch keyboard irq (#1) but failed. The ISR doesn't seem to 
launch...

I made an RTDM driver successfully (with USB4RT) but never managed to do 
that simple thing...

Help would be greatly appreciated,
Thanks a lot,
Antoine







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

* Re: [Xenomai-help] Keyboard IRQ
  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
  0 siblings, 1 reply; 8+ messages in thread
From: Gilles Chanteperdrix @ 2009-03-26 17:37 UTC (permalink / raw)
  To: Antoine Nourry; +Cc: xenomai

Antoine Nourry wrote:
> Hi,
> i need to catch a key press as soon as it is released. What is the best 
> solution ?
> I tried to catch keyboard irq (#1) but failed. The ISR doesn't seem to 
> launch...
> 
> I made an RTDM driver successfully (with USB4RT) but never managed to do 
> that simple thing...

I do not understand your mail. If you use an USB keyboard, then it will
certainly not trigger the IRQ 1.

And given the precision of your question, all we can answer is that you
should read the RTDM driver API documentation.

See:
http://www.catb.org/~esr/faqs/smart-questions.html

-- 
                                                 Gilles.


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

* Re: [Xenomai-help] Keyboard IRQ
  2009-03-26 17:37 ` Gilles Chanteperdrix
@ 2009-03-26 21:04   ` Antoine Nourry
  2009-03-26 21:24     ` Gilles Chanteperdrix
  0 siblings, 1 reply; 8+ messages in thread
From: Antoine Nourry @ 2009-03-26 21:04 UTC (permalink / raw)
  To: Gilles Chanteperdrix; +Cc: xenomai

Sorry for my blurred question, i just wanted to point out the fact that 
i managed to use most of Xenomai API functionalities when i was working 
on an RTDM USB driver. However during my scattered tests i never managed 
to catch properly IRQ 1 (i use a standard keyboard here). The goal is to 
measure time reaction from the moment an image appears to the keypress 
event.  Several months ago i asked you how to achieve this and wasn't 
aware at all of the domain switching when calling non realtime functions 
while being in RT mode. Thus i mixed non realtime and realtime functions 
in the same realtime task... and among them there were different 
keyboard event catch functions whichever are all non RT. I want a 
deterministic program that could rely on Xenomai source clock and on its 
IRQ handling in order to know when to take the measure.

I first want to know if this could be a good way to do so or if i'm 
totally wrong.

Secondly, i just made some new tests from the irq user example and 
rt_intr_wait returns -38 (is it ENOSYS = function not implemented ?) Do 
i have to compile some functionality in the kernel or during Xenomai 
install ?

Thank you again,
Antoine

Gilles Chanteperdrix a écrit :
> Antoine Nourry wrote:
>   
>> Hi,
>> i need to catch a key press as soon as it is released. What is the best 
>> solution ?
>> I tried to catch keyboard irq (#1) but failed. The ISR doesn't seem to 
>> launch...
>>
>> I made an RTDM driver successfully (with USB4RT) but never managed to do 
>> that simple thing...
>>     
>
> I do not understand your mail. If you use an USB keyboard, then it will
> certainly not trigger the IRQ 1.
>
> And given the precision of your question, all we can answer is that you
> should read the RTDM driver API documentation.
>
> See:
> http://www.catb.org/~esr/faqs/smart-questions.html
>
>   




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

* Re: [Xenomai-help] Keyboard IRQ
  2009-03-26 21:04   ` Antoine Nourry
@ 2009-03-26 21:24     ` Gilles Chanteperdrix
  2009-03-26 21:52       ` Antoine Nourry
  0 siblings, 1 reply; 8+ messages in thread
From: Gilles Chanteperdrix @ 2009-03-26 21:24 UTC (permalink / raw)
  To: Antoine Nourry; +Cc: xenomai

Antoine Nourry wrote:
> Sorry for my blurred question, i just wanted to point out the fact that 
> i managed to use most of Xenomai API functionalities when i was working 
> on an RTDM USB driver. However during my scattered tests i never managed 
> to catch properly IRQ 1 (i use a standard keyboard here). The goal is to 
> measure time reaction from the moment an image appears to the keypress 
> event.  Several months ago i asked you how to achieve this and wasn't 
> aware at all of the domain switching when calling non realtime functions 
> while being in RT mode. Thus i mixed non realtime and realtime functions 
> in the same realtime task... and among them there were different 
> keyboard event catch functions whichever are all non RT. I want a 
> deterministic program that could rely on Xenomai source clock and on its 
> IRQ handling in order to know when to take the measure.
> 
> I first want to know if this could be a good way to do so or if i'm 
> totally wrong.

I think I already told you that, but using Xenomai to do that is
completely overkill.

> 
> Secondly, i just made some new tests from the irq user example and 
> rt_intr_wait returns -38 (is it ENOSYS = function not implemented ?) Do 
> i have to compile some functionality in the kernel or during Xenomai 
> install ?

Yes, handling interrupts in user-space with the native and posix skins
is discouraged. You should be using the RTDM skin. But if you absolutely
want to use these services, you have to enable them in the kernel
configuration.


-- 
					    Gilles.


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

* Re: [Xenomai-help] Keyboard IRQ
  2009-03-26 21:24     ` Gilles Chanteperdrix
@ 2009-03-26 21:52       ` Antoine Nourry
  2009-03-26 21:58         ` Gilles Chanteperdrix
  0 siblings, 1 reply; 8+ messages in thread
From: Antoine Nourry @ 2009-03-26 21:52 UTC (permalink / raw)
  To: Gilles Chanteperdrix; +Cc: xenomai

Gilles Chanteperdrix a écrit :
> Antoine Nourry wrote:
>   
>> Sorry for my blurred question, i just wanted to point out the fact that 
>> i managed to use most of Xenomai API functionalities when i was working 
>> on an RTDM USB driver. However during my scattered tests i never managed 
>> to catch properly IRQ 1 (i use a standard keyboard here). The goal is to 
>> measure time reaction from the moment an image appears to the keypress 
>> event.  Several months ago i asked you how to achieve this and wasn't 
>> aware at all of the domain switching when calling non realtime functions 
>> while being in RT mode. Thus i mixed non realtime and realtime functions 
>> in the same realtime task... and among them there were different 
>> keyboard event catch functions whichever are all non RT. I want a 
>> deterministic program that could rely on Xenomai source clock and on its 
>> IRQ handling in order to know when to take the measure.
>>
>> I first want to know if this could be a good way to do so or if i'm 
>> totally wrong.
>>     
>
> I think I already told you that, but using Xenomai to do that is
> completely overkill.
>
>   
>> Secondly, i just made some new tests from the irq user example and 
>> rt_intr_wait returns -38 (is it ENOSYS = function not implemented ?) Do 
>> i have to compile some functionality in the kernel or during Xenomai 
>> install ?
>>     
>
> Yes, handling interrupts in user-space with the native and posix skins
> is discouraged. You should be using the RTDM skin. But if you absolutely
> want to use these services, you have to enable them in the kernel
> configuration.
>
>
>   
I neither understand, is there a way to measure precisely the absolute 
time of a keypress event on our computers ?



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

* Re: [Xenomai-help] Keyboard IRQ
  2009-03-26 21:52       ` Antoine Nourry
@ 2009-03-26 21:58         ` Gilles Chanteperdrix
  2009-03-26 22:49           ` Antoine Nourry
  0 siblings, 1 reply; 8+ messages in thread
From: Gilles Chanteperdrix @ 2009-03-26 21:58 UTC (permalink / raw)
  To: Antoine Nourry; +Cc: xenomai

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.

-- 
					    Gilles.


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

* Re: [Xenomai-help] Keyboard IRQ
  2009-03-26 21:58         ` Gilles Chanteperdrix
@ 2009-03-26 22:49           ` Antoine Nourry
  2009-03-26 22:55             ` Gilles Chanteperdrix
  0 siblings, 1 reply; 8+ messages in thread
From: Antoine Nourry @ 2009-03-26 22:49 UTC (permalink / raw)
  To: Gilles Chanteperdrix; +Cc: xenomai

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. Moreover aren't 
there any risks of being preempted or slowed by other tasks ?



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

* Re: [Xenomai-help] Keyboard IRQ
  2009-03-26 22:49           ` Antoine Nourry
@ 2009-03-26 22:55             ` Gilles Chanteperdrix
  0 siblings, 0 replies; 8+ messages in thread
From: Gilles Chanteperdrix @ 2009-03-26 22:55 UTC (permalink / raw)
  To: Antoine Nourry; +Cc: xenomai

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.



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

end of thread, other threads:[~2009-03-26 22:55 UTC | newest]

Thread overview: 8+ messages (download: mbox.gz follow: Atom feed
-- links below jump to the message on this page --
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 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.