Page 3 of 3

Re: Cyclic timers

PostPosted: Thu Feb 13, 2003 10:21 am
by luben

Having a single task was much cleaner and simpler than having lots of little tasks, each doing one small thing.

When using variable approach (like I described) the whole functionality that fakes cyclic timers is made only IN ONE SINGEL task, that wakes up periodically.


Re: Cyclic timers

PostPosted: Sun Mar 16, 2003 6:40 am
by aek
Hi John.

Here are the protos:

OStypeErr   OSCreateCycTmr   ( OStypeTFP       tFP, 
OStypeTcbP tcbP,
OStypeDelay delay,
OStypeDelay period,
OStypeCTMode mode );

OStypeErr OSCycTmrRunning ( OStypeTcbP tcbP );

OStypeErr OSDestroyCycTmr ( OStypeTcbP tcbP );

OStypeErr OSResetCycTmr ( OStypeTcbP tcbP );

OStypeErr OSSetCycTmrPeriod ( OStypeTcbP tcbP,
OStypeDelay period );

OStypeErr OSStartCycTmr ( OStypeTcbP tcbP );

OStypeErr OSStopCycTmr ( OStypeTcbP tcbP );

A few notes:

1) One-shot and continuous modes are supported.

when creating a cycTmr.

3) The initial delay and the period must each be non-zero.

4) A cycTmr's period can be changed on-the-fly. The change will take effect after
the timer times out (if running).

5) When resetting a cycTmr, delay is not used -- the timer will time out period ticks from now.

6) By "running", what is meant is the timer will time out in the future. A one-shot time is no longer running after it times out, and a stopped timer is also not running.

Currently, cycTmrs incur no additional RAM costs if timeouts are enabled. IOW, they're a shoo-in for the -t libraries. I haven't yet worked them into a more independent configuration.

Look good?


[This message has been edited by aek (edited March 16, 2003).]

Re: Cyclic timers

PostPosted: Sun Mar 16, 2003 11:31 am
by jtemples
Looks good to me.