Re: 1.3msec timer needed - best way ?

From: yodaiken@fsmlabs.com
Date: Wed May 03 2000 - 22:22:44 EST


The answer is obvious: The RTLinux code is mostly ..

 thread_t t;
 pthread_create (&t, 0, thread_code, (void *)1);
 pthread_make_periodic_np(t, gethrtime(), 1300000); /*run ever 1.3 millsec*/
----------------

 void *thread_code(void *t)
{
   write data out
   pthread_wait_np(pthread_self());
}

On Wed, May 03, 2000 at 04:51:59PM -0400, Paul Barton-Davis wrote:
> I need to write 2 bytes to a device every 1.3msec (+/- 0.3msec). I
> know how to use the kernel timer system, and I know how to use the
> RTC. But I don't know how I can do this on time, because its not a
> multiple of 2, and the RTC requires this.
>
> Does anyone have any ideas ? In case you wonder, this is to generate
> MIDI timecode, which consists, in its most basic form, of a 2 byte
> message for every 1/4 SMPTE frame, where there are roughly 20-30 SMPTE
> frames per second.
>
> --p
>
>
> -
> To unsubscribe from this list: send the line "unsubscribe linux-kernel" in
> the body of a message to majordomo@vger.rutgers.edu
> Please read the FAQ at http://www.tux.org/lkml/

-- 
---------------------------------------------------------
Victor Yodaiken 
FSMLabs:  www.fsmlabs.com  www.rtlinux.com
FSMLabs is a servicemark and a service of 
VJY Associates L.L.C, New Mexico.

- To unsubscribe from this list: send the line "unsubscribe linux-kernel" in the body of a message to majordomo@vger.rutgers.edu Please read the FAQ at http://www.tux.org/lkml/



This archive was generated by hypermail 2b29 : Sun May 07 2000 - 21:00:13 EST