All of lore.kernel.org
 help / color / mirror / Atom feed
* [Xenomai-help] timed looping task in device driver
@ 2009-02-06  0:22 Zara Tustra
  2009-02-06  9:24 ` Sebastian Smolorz
  0 siblings, 1 reply; 7+ messages in thread
From: Zara Tustra @ 2009-02-06  0:22 UTC (permalink / raw)
  To: xenomai

[-- Attachment #1: Type: text/plain, Size: 214 bytes --]

How would I set up a task that, say, turns a led on and off every second, in
a device driver (module)? I've tried using rtdm_task_init and it's
successful, but when I use rtdm_task_wait_period, it returns -EINVAL.

[-- Attachment #2: Type: text/html, Size: 226 bytes --]

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

* Re: [Xenomai-help] timed looping task in device driver
  2009-02-06  0:22 [Xenomai-help] timed looping task in device driver Zara Tustra
@ 2009-02-06  9:24 ` Sebastian Smolorz
  2009-02-06 10:35   ` Zara Tustra
  0 siblings, 1 reply; 7+ messages in thread
From: Sebastian Smolorz @ 2009-02-06  9:24 UTC (permalink / raw)
  To: Zara Tustra; +Cc: xenomai

Zara Tustra wrote:
> How would I set up a task that, say, turns a led on and off every second, in
> a device driver (module)? I've tried using rtdm_task_init and it's
> successful, but when I use rtdm_task_wait_period, it returns -EINVAL.

Xenomai has a useful API documentation where all API calls and the 
return values are well explained. For your case see

http://www.xenomai.org/documentation/branches/v2.4.x/html/api/group__rtdmtask.html#g577886a7588cdceac10f1b7b6ffcd1c7

-- 
Sebastian


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

* Re: [Xenomai-help] timed looping task in device driver
  2009-02-06  9:24 ` Sebastian Smolorz
@ 2009-02-06 10:35   ` Zara Tustra
  2009-02-06 11:40     ` Sebastian Smolorz
  0 siblings, 1 reply; 7+ messages in thread
From: Zara Tustra @ 2009-02-06 10:35 UTC (permalink / raw)
  To: Sebastian Smolorz; +Cc: xenomai

[-- Attachment #1: Type: text/plain, Size: 790 bytes --]

Yes, I have read the API documentation.

> -EINVAL is returned if calling task is not in periodic mode.

How am I to put it in periodic mode then, if rtdm_task_init isn't doing it
for me?

On Fri, Feb 6, 2009 at 7:24 AM, Sebastian Smolorz <
smolorz@domain.hid> wrote:

> Zara Tustra wrote:
>
>> How would I set up a task that, say, turns a led on and off every second,
>> in
>> a device driver (module)? I've tried using rtdm_task_init and it's
>> successful, but when I use rtdm_task_wait_period, it returns -EINVAL.
>>
>
> Xenomai has a useful API documentation where all API calls and the return
> values are well explained. For your case see
>
>
> http://www.xenomai.org/documentation/branches/v2.4.x/html/api/group__rtdmtask.html#g577886a7588cdceac10f1b7b6ffcd1c7
>
> --
> Sebastian
>

[-- Attachment #2: Type: text/html, Size: 1468 bytes --]

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

* Re: [Xenomai-help] timed looping task in device driver
  2009-02-06 10:35   ` Zara Tustra
@ 2009-02-06 11:40     ` Sebastian Smolorz
  2009-02-06 12:22       ` Zara Tustra
  0 siblings, 1 reply; 7+ messages in thread
From: Sebastian Smolorz @ 2009-02-06 11:40 UTC (permalink / raw)
  To: Zara Tustra; +Cc: xenomai

Zara Tustra wrote:
> Yes, I have read the API documentation.
> 
>> -EINVAL is returned if calling task is not in periodic mode.
> 
> How am I to put it in periodic mode then, if rtdm_task_init isn't doing it
> for me?

How does your rtdm_task_init() call looks like?

-- 
Sebastian


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

* Re: [Xenomai-help] timed looping task in device driver
  2009-02-06 11:40     ` Sebastian Smolorz
@ 2009-02-06 12:22       ` Zara Tustra
  2009-02-06 12:37         ` Sebastian Smolorz
  0 siblings, 1 reply; 7+ messages in thread
From: Zara Tustra @ 2009-02-06 12:22 UTC (permalink / raw)
  To: Sebastian Smolorz; +Cc: xenomai

[-- Attachment #1: Type: text/plain, Size: 649 bytes --]

ret=rtdm_task_init (&toggle_led_task, "toggling_led", &toggling_led_proc,
NULL, 10, 1000000000);

  if (ret) {
    printk(KERN_DEBUG "error while setting periodic, code %d\n", ret);
    return;
  }
    else printk(KERN_DEBUG "task set periodic successfully\n");

On Fri, Feb 6, 2009 at 9:40 AM, Sebastian Smolorz <
smolorz@domain.hid> wrote:

> Zara Tustra wrote:
>
>> Yes, I have read the API documentation.
>>
>>  -EINVAL is returned if calling task is not in periodic mode.
>>>
>>
>> How am I to put it in periodic mode then, if rtdm_task_init isn't doing it
>> for me?
>>
>
> How does your rtdm_task_init() call looks like?
>
> --
> Sebastian
>

[-- Attachment #2: Type: text/html, Size: 1406 bytes --]

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

* Re: [Xenomai-help] timed looping task in device driver
  2009-02-06 12:22       ` Zara Tustra
@ 2009-02-06 12:37         ` Sebastian Smolorz
       [not found]           ` <57e813c90902060815m1d6a6642re65481fc47874ae6@domain.hid>
  0 siblings, 1 reply; 7+ messages in thread
From: Sebastian Smolorz @ 2009-02-06 12:37 UTC (permalink / raw)
  To: Zara Tustra; +Cc: xenomai

Zara Tustra wrote:
> ret=rtdm_task_init (&toggle_led_task, "toggling_led", &toggling_led_proc,
> NULL, 10, 1000000000);
> 
>   if (ret) {
>     printk(KERN_DEBUG "error while setting periodic, code %d\n", ret);
>     return;
>   }
>     else printk(KERN_DEBUG "task set periodic successfully\n");
> 

Where do you call rtdm_task_wait_period()? Inside the RT task function?

Have a look at examples/rtdm/driver-api/heartbeat.c. Compare it to your 
code and try it out. Does it work?

-- 
Sebastian


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

* Re: [Xenomai-help] timed looping task in device driver
       [not found]           ` <57e813c90902060815m1d6a6642re65481fc47874ae6@domain.hid>
@ 2009-02-09  9:09             ` Sebastian Smolorz
  0 siblings, 0 replies; 7+ messages in thread
From: Sebastian Smolorz @ 2009-02-09  9:09 UTC (permalink / raw)
  To: Zara Tustra; +Cc: xenomai-help

Zara Tustra wrote:
>> Where do you call rtdm_task_wait_period()? Inside the RT task function?
> 
> Yes. rtdm_task_sleep_abs works, aggravatingly enough.
> 
>> Have a look at examples/rtdm/driver-api/heartbeat.c. Compare it to your
> code and try it out. Does it work?
> 
> heartbeat doesn't seem to work either. I'm starting to think it's either a
> issue of how the kernel was compiled or how the driver is being compiled.

Which versions of the Linux kernel, I-pipe and Xenomai do you use? And 
which CPU? Could you send us your .config?

Please do not drop the Xenomai ML in your replies.

-- 
Sebastian


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

end of thread, other threads:[~2009-02-09  9:09 UTC | newest]

Thread overview: 7+ messages (download: mbox.gz follow: Atom feed
-- links below jump to the message on this page --
2009-02-06  0:22 [Xenomai-help] timed looping task in device driver Zara Tustra
2009-02-06  9:24 ` Sebastian Smolorz
2009-02-06 10:35   ` Zara Tustra
2009-02-06 11:40     ` Sebastian Smolorz
2009-02-06 12:22       ` Zara Tustra
2009-02-06 12:37         ` Sebastian Smolorz
     [not found]           ` <57e813c90902060815m1d6a6642re65481fc47874ae6@domain.hid>
2009-02-09  9:09             ` Sebastian Smolorz

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.