* [Xenomai-help] interrupt wait problem
@ 2006-03-14 9:32 marcellin
2006-03-14 13:23 ` Dmitry Adamushko
2006-03-14 13:28 ` Gilles Chanteperdrix
0 siblings, 2 replies; 3+ messages in thread
From: marcellin @ 2006-03-14 9:32 UTC (permalink / raw)
To: xenomai
Hi, i'm trying to use the RealTimeClock IRQ 8, with a xenomai real time
task. I configure the RTC to have a periodic interrupt on it with the
linux standard API, and it works. After when i want to catch the IRQ 8
in a xenomai real time task i have a problem a error ( " Operation not
permitted ") with the " rt_intr_wait " fonction. Is there a special
initialisation or configuration to make with the kernel or Xenomai ?
my conf : kernel 2.6.15.1 , Xenomai-2.1-rc4
in my program
//initialisation
err = rt_intr_create(&intr_desc,"IRQ8",IRQ8,I_PROPAGATE);
if(err){
printf("AcqProcess -> failed to create interupt object :
%s",strerror(-err));
}
err = rt_intr_enable(&intr_desc);
if(err){
printf("AcqProcess -> failed to enable interupt object :
%s",strerror(-err));
}
err =
rt_task_create(&time_task,"SecondTask",TASK_STKSZ,TASK_PRIO,T_FPU|T_JOINABLE);
if(err){
printf("AcqProcess -> failed to create task :
%s",strerror(-err));
}
rt_task_start(&time_task,&timer_handler_thread,NULL);
//in the irq task
err = rt_intr_wait( &intr_desc,TIMEOUT );
if(err){
printf("AcqProcess -> failed to wait interrupt :
%s",strerror(-err));
}
regards
Marcell1
^ permalink raw reply [flat|nested] 3+ messages in thread
* Re: [Xenomai-help] interrupt wait problem
2006-03-14 9:32 [Xenomai-help] interrupt wait problem marcellin
@ 2006-03-14 13:23 ` Dmitry Adamushko
2006-03-14 13:28 ` Gilles Chanteperdrix
1 sibling, 0 replies; 3+ messages in thread
From: Dmitry Adamushko @ 2006-03-14 13:23 UTC (permalink / raw)
To: marcellin; +Cc: xenomai
On 14/03/06, marcellin <marcellin.fotze@domain.hid> wrote:
>
> //in the irq task
>
>
> err = rt_intr_wait( &intr_desc,TIMEOUT );
> if(err){
> printf("AcqProcess -> failed to wait interrupt :
> %s",strerror(-err));
> }
On success, rt_intr_wait() returns a positive value equal to a number
of currently pending interrupts and not 0.
Although, I don't know how e.g. 1 would be interpreted as "an
operation not permited" with strerror(). strerror(-1) should have
given an "unknown error" or smth like this.
Anyway, please take a look at what exactly the return value is :
negative or positive.
>
> regards
>
> Marcell1
--
Best regards,
Dmitry Adamushko
^ permalink raw reply [flat|nested] 3+ messages in thread
* Re: [Xenomai-help] interrupt wait problem
2006-03-14 9:32 [Xenomai-help] interrupt wait problem marcellin
2006-03-14 13:23 ` Dmitry Adamushko
@ 2006-03-14 13:28 ` Gilles Chanteperdrix
1 sibling, 0 replies; 3+ messages in thread
From: Gilles Chanteperdrix @ 2006-03-14 13:28 UTC (permalink / raw)
To: marcellin; +Cc: xenomai
marcellin wrote:
>
>
> Hi, i'm trying to use the RealTimeClock IRQ 8, with a xenomai real time
> task. I configure the RTC to have a periodic interrupt on it with the
> linux standard API, and it works. After when i want to catch the IRQ 8
> in a xenomai real time task i have a problem a error ( " Operation not
> permitted ") with the " rt_intr_wait " fonction. Is there a special
> initialisation or configuration to make with the kernel or Xenomai ?
As mentioned by Jan, rt_intr_wait() and generally every service which
block its caller may only be called from a real-time task, i.e. a task
created with rt_task_create() or made real-time with rt_task_shadow().
Also note that Xenomai system timer allow high frequency periodic
tasks without resorting to the RTC, see rt_task_set_periodic() and
rt_task_wait_period() services.
--
Gilles Chanteperdrix.
^ permalink raw reply [flat|nested] 3+ messages in thread
end of thread, other threads:[~2006-03-14 13:28 UTC | newest]
Thread overview: 3+ messages (download: mbox.gz follow: Atom feed
-- links below jump to the message on this page --
2006-03-14 9:32 [Xenomai-help] interrupt wait problem marcellin
2006-03-14 13:23 ` Dmitry Adamushko
2006-03-14 13:28 ` 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.