I didn't get much response on my question about sysTimerX functions so I
went hunting on my own. Here's what I found: (I'm still looking for more
info.)

To create a timer you use the sysTimerCreate, the sysTimerCreate id declared
as:
Err  SysTimerCreate(DWordPtr timerIDP, DWordPtr tagP,
       SysTimerProcPtr timerProc, DWord periodicDelay,
       DWord param)

I don't know what the parameters tagP and param are used for, but the
timerIDP is a pointer to the ID of the timer used to start, stop and delete
the timer. If you want a timer that calls your callback routine continuously
in given intervals you set the periodicDelay param to ass many ticks you
want between the callbacks. If you want a single callback timer you set till
parameter to 0.

The callback routine pointer you specify should be of type:
typedef void (*SysTimerProcPtr)(Long timerID, Long param);

Now, in order to get a created timer running you use sysTimerWrite, declared
as:
Err  SysTimerWrite(DWord timerID, DWord value)

You pass this function the ID of your timer and a value indicating the
number of ticks until next callback (Do not set this to zero). This
activates your timer.

When your program exits or when your done with your timer you must delete it
using sysTimerDelete. This function is declared as:
Err  SysTimerDelete(DWord timerID)

*IMPORTANT*
Before you call the sysTimerDelete function you must stop the timer using
sysTimerWrite, passing the value 0 (Yes, now you can pass the value 0). Now,
when you've stopped the timer, it's safe to delete it using sysTimerDelete.

There is also a sysTimerRead function declared as:
Err  SysTimerRead(DWord timerID, DWordPtr valueP)

I haven't tested this function, but I'm sure you understand how to use it.



The above information is based on my 3 hours experience with timers so there
could be some faulty assumptions here, but timers seem to work fine for me
(I use OS 3.1.1).

And again, any information regarding timers would certainly interest me.
Do not hesitate to let me know if any of the above is faulty of inaccurate.


Petrus



-- 
For information on using the Palm Developer Forums, or to unsubscribe, please see 
http://www.palmos.com/dev/tech/support/forums/

Reply via email to