Pumpkin, Inc.

Pumpkin User Forums

Cyclic timers

Have an idea on how to make Salvo better? Post it here!

Re: Cyclic timers

Postby luben » Thu Feb 13, 2003 10:21 am


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.


Posts: 324
Joined: Sun Nov 19, 2000 12:00 am
Location: Sofia, Bulgaria

Re: Cyclic timers

Postby aek » Sun Mar 16, 2003 6:40 am

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).]

Posts: 1888
Joined: Sat Aug 26, 2000 11:00 pm

Re: Cyclic timers

Postby jtemples » Sun Mar 16, 2003 11:31 am

Looks good to me.
Posts: 45
Joined: Tue Jul 16, 2002 11:00 pm


Return to Feature Requests

Who is online

Users browsing this forum: No registered users and 1 guest