timers...

bridged with qdn.public.ddk.input
Post Reply
Berkeley Process Control

timers...

Post by Berkeley Process Control » Tue Jun 26, 2001 7:18 pm

Hi,

In my driver, I need to have a simple interval timer calling me
once every 10 millisecond.

I looked at the io-char driver and it seems a bit more complex
than what I need.

So, at this point I am looking for a simple way of being called
once every 10 millisecond. Any easy syscall to do this? the
first step for me would be a "hello world" program which simply
prints an "*" every 10 milliseconds. and the next step would be to
make it send the driver a msg instead of printing "*"..

Thanks

Eric Berdahl

Re: timers...

Post by Eric Berdahl » Tue Jun 26, 2001 10:25 pm

In article <9hanl5$i1s$1@inn.qnx.com>,
"Berkeley Process Control" <bpc@berkeleyprocess.com> wrote:
So, at this point I am looking for a simple way of being called
once every 10 millisecond. Any easy syscall to do this? the
first step for me would be a "hello world" program which simply
prints an "*" every 10 milliseconds. and the next step would be to
make it send the driver a msg instead of printing "*"..
If you're looking for drift-free timing, check out the timer_create
function. In one of my systems, I use this mechanism to provide a
regular refresh to a display device. This link has a good description
and sample code:

<http://qdn.qnx.com/support/docs/neutrin ... reate.html
You could also go into a loop where you call delay to wait 10ms. The
biggest advantage of using timers is that they will give you drift-free
timing.

Hope this helps,
Eric

Didier Harrang

Re: timers...

Post by Didier Harrang » Wed Jun 27, 2001 10:53 am

You might want to attach to interrupt 0.
On qnx4 it is usually occuring every 10ms, I don't know the value for RTP.

You simply trigger a proxy (your IRQ0 handler returns the proxy value), when
the correct time is elapsed (if it is not every interrupt you have to
count). And in your main you wait for the proxy.

I'm not very aware of the RTP terminology, but I'm sure there's an
equivalent to proxies!

Hope this helps.

Didier.

Berkeley Process Control <bpc@berkeleyprocess.com> a écrit dans le message :
9hanl5$i1s$1@inn.qnx.com...
Hi,

In my driver, I need to have a simple interval timer calling me
once every 10 millisecond.

I looked at the io-char driver and it seems a bit more complex
than what I need.

So, at this point I am looking for a simple way of being called
once every 10 millisecond. Any easy syscall to do this? the
first step for me would be a "hello world" program which simply
prints an "*" every 10 milliseconds. and the next step would be to
make it send the driver a msg instead of printing "*"..

Thanks

Post Reply

Return to “qdn.public.ddk.input”