All of lore.kernel.org
 help / color / mirror / Atom feed
* [Xenomai-help] periodical task in posix skin
@ 2010-08-23 18:59 ramon costa
  2010-08-23 20:23 ` Gilles Chanteperdrix
  0 siblings, 1 reply; 7+ messages in thread
From: ramon costa @ 2010-08-23 18:59 UTC (permalink / raw)
  To: Xenomai help


[-- Attachment #1.1: Type: text/plain, Size: 1131 bytes --]

Hi,

I have developed a very simple task in native code and it works fine
(included in native.tar.gz). This
simple task generates a square waveform through the parallel port ( and also
the speaker).

Currently I'm trying to transform this code into the POSIX skin (Makefile
and .c included in posix,tar.gz).
Unfortunatelly It does not work, although the parallel port shows a square
waveform its period is not the desired
one (0.1ms), its period is very small. This makes the system to freeze.

It seems that pthread_wait_np is not working properly, or may be I'm not
using pthread_make_periodic_np
properly. I used it in the following way :

        #define PERIOD 100000

        clock_gettime      ( CLOCK_REALTIME, &now);
        pthread_make_periodic_np (pthread_self(), &now, (struct timespec
*)PERIOD);

I also have tried

       struct timespec period;
       period.tv_sec=0;
       period.tv_nsec=PERIOD;

        clock_gettime      ( CLOCK_REALTIME, &now);
        pthread_make_periodic_np (pthread_self(), &now,&period);

Although both compile and execute, non of them works fine to me. Any clue ?


Best wishes,
Ramon

[-- Attachment #1.2: Type: text/html, Size: 1281 bytes --]

[-- Attachment #2: native.tar.gz --]
[-- Type: application/x-gzip, Size: 1394 bytes --]

[-- Attachment #3: posix.tar.gz --]
[-- Type: application/x-gzip, Size: 1575 bytes --]

^ permalink raw reply	[flat|nested] 7+ messages in thread
* Re: [Xenomai-help] periodical task in posix skin
@ 2010-08-24 13:16 Ramon
  0 siblings, 0 replies; 7+ messages in thread
From: Ramon @ 2010-08-24 13:16 UTC (permalink / raw)
  To: Xenomai help

Hi,

I'm sorry in my previous email I made an error.

If I use

clock_gettime      ( TIMER_ABSTIME, &now);
now.tv_nsec=now.tv_nsec+PERIOD;
out=pthread_make_periodic_np (pthread_self(), &now,&period);
......

it always says that "the start time has already passed\n". Differently 
if I use

clock_gettime      ( CLOCK_REALTIME, &now);
        now.tv_nsec=now.tv_nsec+PERIOD;
        out=pthread_make_periodic_np (pthread_self(), &now,&period);

  everything works fine.


Ramon


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

end of thread, other threads:[~2010-08-24 13:16 UTC | newest]

Thread overview: 7+ messages (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
2010-08-23 18:59 [Xenomai-help] periodical task in posix skin ramon costa
2010-08-23 20:23 ` Gilles Chanteperdrix
2010-08-24 10:25   ` ramon costa
2010-08-24 12:13     ` Gilles Chanteperdrix
2010-08-24 13:09       ` Ramon
2010-08-24 13:11         ` Gilles Chanteperdrix
2010-08-24 13:16 Ramon

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.