330
K
A
DAK
AMX 86 Procedures
ajtmcre ajtmcre
Purpose Create an Interval Timer
Used by n Task o IS P o Timer Procedure n Restart Procedure n Exit Procedure
Setup void tproc();
AMXID timerid;
long tperiod;
struct tuser *tparam;
char tag[4];
int status;
.
.
status = ajtmcre(&timerid, tperiod, tproc, tparam, tag);
AX DX= ES:BX is A(Timer Definition Structure)
See structure AMXTMS defined in header
file AMX831SD.DEF (see Appendix D).
Where &timerid is a pointer to storage for the timer id of the timer allocated to
the caller.
tperiod is the timer interval (in AMX system ticks) to be used if the timer
is periodic. Tperiod must be positive. tperiod = 0 for a one-shot
timer.
tproc is a pointer to the Timer Procedure to be executed whenever the
timer expires.
tparam is a 4-byte parameter which will be passed to the Timer Procedure
whenever it is called by AMX. It is usually a pointer to some
application variable or structure such as tuser in the above example.
tag is a 4-character name tag for the timer.
Results Interrupts are disabled and then restored to their state at the time of the
call.
Status is returned.
AEROK = Call successful
AERNTM = No free timer
AERTMV = Invalid period (<0)
If the call is unsuccessful, timerid is undefined.
Note Creating an interval timer does not automatically start the timer. Use
ajtmwr to start the timer.
See Also ajtmdel, ajtmtag